From f5b0724f3b4cd3b14b152cba28a8f9c31b323f22 Mon Sep 17 00:00:00 2001 From: Vincent Emonet Date: Mon, 30 Sep 2024 15:04:52 +0200 Subject: [PATCH] comments --- backend/src/upload.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/src/upload.py b/backend/src/upload.py index f039176..432969d 100644 --- a/backend/src/upload.py +++ b/backend/src/upload.py @@ -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: @@ -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