Skip to content

Commit

Permalink
Handle NaN for mapping_set_version and mapping_set_license
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaris committed Oct 25, 2023
1 parent 3383462 commit de85436
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/semra/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,18 @@ def _parse_sssom_row(row, mapping_set_name=None) -> Mapping:
else:
n = mapping_set_name
confidence = None
mapping_set_version = None
mapping_set_license = None
if "mapping_set_confidence" in row and pd.notna(row["mapping_set_confidence"]):
confidence = row["mapping_set_confidence"]

if "mapping_set_version" in row and pd.notna(row["mapping_set_version"]):
mapping_set_version = row["mapping_set_version"]
if "mapping_set_license" in row and pd.notna(row["mapping_set_license"]):
mapping_set_license = row["mapping_set_license"]
mapping_set = MappingSet(
name=n,
version=row.get("mapping_set_version"),
license=row.get("mapping_set_license"),
version=mapping_set_version,
license=mapping_set_license,
confidence=confidence,
)
if "mapping_justification" in row and pd.notna(row["mapping_justification"]):
Expand Down

0 comments on commit de85436

Please sign in to comment.