Skip to content

Commit

Permalink
Handle multiselect case differently in read_arc_schema()
Browse files Browse the repository at this point in the history
  • Loading branch information
abhidg committed Nov 18, 2024
1 parent 390e4ad commit b885de0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/arcmapper/arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def read_arc_schema(
arc_version_or_file: str, preset: str | None = None
) -> pd.DataFrame:
types_mapping: dict[str, DataType] = {
"radio": "categorical",
"radio": "enum",
"number": "number",
"text": "string",
"date_dmy": "date",
"checkbox": "categorical",
"dropdown": "categorical",
"checkbox": "multiselect",
"dropdown": "enum",
"datetime_dmy": "date",
}
arc_location = (
Expand Down
2 changes: 2 additions & 0 deletions src/arcmapper/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def get_match_dataframe_from_similarity_matrix(
"arc_variable",
"arc_description",
"arc_response",
"arc_type",
"rank",
],
data=sum(
Expand All @@ -71,6 +72,7 @@ def get_match_dataframe_from_similarity_matrix(
arc.iloc[k].variable,
arc.iloc[k].description,
arc.iloc[k].responses,
arc.iloc[k].type,
j,
]
for j, k in enumerate(S[i])
Expand Down
2 changes: 1 addition & 1 deletion src/arcmapper/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# example: gender = [(1, "male"), (2, "female")]
Responses = list[str] | list[tuple[str | int, str]]

DataType = Literal["categorical", "number", "string", "date"]
DataType = Literal["enum", "number", "string", "date", "multiselect"]


class PossibleMatch(NamedTuple):
Expand Down

0 comments on commit b885de0

Please sign in to comment.