Skip to content

Commit 381e547

Browse files
authored
Add explicit handling of NaNs when loading semantic mappings (#473)
Follow-up to cthoyt/sssom-pydantic#44
1 parent 23ac0f2 commit 381e547

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ dependencies = [
8989
"typing_extensions",
9090
"rdflib",
9191
"obographs>=0.0.8",
92-
"sssom_pydantic>=0.1.1",
92+
"sssom_pydantic>=0.2.0",
9393
"pytz",
9494
]
9595

src/pyobo/api/xrefs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ def get_semantic_mappings(
124124
)
125125
if converter is None:
126126
converter = get_converter()
127-
return [row_to_semantic_mapping(row, converter=converter) for _, row in df.iterrows()]
127+
return [
128+
# TODO upstream this into sssom-pydantic?
129+
row_to_semantic_mapping({k: v for k, v in row.items() if pd.notna(v)}, converter=converter)
130+
for _, row in df.iterrows()
131+
]
128132

129133

130134
def get_mappings_df(

0 commit comments

Comments
 (0)