Skip to content

Commit

Permalink
added a check to ensure unit is set to the default value N/A when the…
Browse files Browse the repository at this point in the history
… unit value is None
  • Loading branch information
ChaoPang committed Oct 11, 2024
1 parent fb578ab commit 44c2cff
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ def transform(self, record: Dict[str, Any]) -> Dict[str, Any]:

# If numeric_value exists, this is a concept/value tuple, we indicate this using a concept_value_mask
numeric_value = e.get("numeric_value", None)
unit = e.get("unit", NA)
# The unit might be populated with a None value
unit = e.get("unit", NA) if e.get("unit", NA) else NA
concept_value_mask = int(numeric_value is not None)
concept_value = numeric_value if concept_value_mask == 1 else -1.0
code = replace_escape_chars(e["code"])
Expand Down

0 comments on commit 44c2cff

Please sign in to comment.