Skip to content

Commit

Permalink
(HP-1932) add type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
george42-ctds committed Feb 20, 2025
1 parent fe776a6 commit 8f95b07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions heal/vlmd/extract/redcap_csv_dict_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def rename_and_fill(source_dataframe) -> list[dict]:
return source_dataframe.to_dict(orient="records")


def _add_description(source_field, target_field):
def _add_description(source_field: dict, target_field: dict) -> str:
if source_field.get("label"):
field_label = source_field["label"].strip()
else:
Expand All @@ -81,7 +81,7 @@ def _add_description(source_field, target_field):
return "No field label for this variable"


def _add_title(source_field, target_field):
def _add_title(source_field: dict, target_field: dict) -> str:
target_title = target_field.get("title", "")

if target_title:
Expand All @@ -92,12 +92,12 @@ def _add_title(source_field, target_field):
return "No field label for this variable"


def _add_section(source_field):
def _add_section(source_field: dict):
if source_field.get("form"):
return source_field["form"]


def _add_metadata(source_field, target_field):
def _add_metadata(source_field: dict, target_field: dict):
target_field["description"] = _add_description(source_field, target_field)
target_field["title"] = _add_title(source_field, target_field)
target_field["section"] = _add_section(source_field)
Expand Down

0 comments on commit 8f95b07

Please sign in to comment.