Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Sep 30, 2024
1 parent 9639c4b commit f5b0724
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/src/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ def load_cohort_dict_file(dict_path: str, cohort_id: str) -> Dataset:
detail=f"Missing column `{column}`",
)
df["categories"] = df["CATEGORICAL"].apply(parse_categorical_string)


# TODO: handle columns from Komal that maps variables:
if "Label Concept Code" in df.columns:
df["concept_id"] = df.apply(lambda row: str(row["Label Concept Code"]).strip(), axis=1)
else:
Expand Down Expand Up @@ -357,6 +360,8 @@ async def upload_cohort(
with open(metadata_path, "wb") as buffer:
shutil.copyfileobj(cohort_dictionary.file, buffer)

# TODO: KOMAL add function that reads the CSV at `metadata_path`, add new columns, and save it back to the same file

try:
g = load_cohort_dict_file(metadata_path, cohort_id)
# Airlock preview setting goes to mapping graph because it is defined in the explorer UI
Expand Down

0 comments on commit f5b0724

Please sign in to comment.