Skip to content

Commit

Permalink
automatically convert VAR TYPE column to uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Oct 17, 2024
1 parent 1fc3d04 commit 4f9ab10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/src/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ def load_cohort_dict_file(dict_path: str, cohort_id: str) -> Dataset:
g.add((cohort_uri, RDF.type, ICARE.Cohort, cohort_uri))
g.add((cohort_uri, DC.identifier, Literal(cohort_id), cohort_uri))

# Make sure variable types are all uppercase
df["VAR TYPE"] = df.apply(lambda row: str(row["VAR TYPE"]).upper(), axis=1)

for i, row in df.iterrows():
# Check if required columns are present
if not row["VARIABLE NAME"] or not row["VARIABLE LABEL"] or not row["VAR TYPE"] or not row["COUNT"]:
Expand Down

0 comments on commit 4f9ab10

Please sign in to comment.