Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/mxcp/sdk/validator/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ class TypeConverter:
@staticmethod
def _normalize_pandas_dataframe_nulls(value: pd.DataFrame) -> pd.DataFrame:
"""Convert pandas null sentinels into Python None for output handling."""
return value.astype(object).where(value.notna(), None)
# pandas-stubs rejects None as the `other` arg of where(), but it is supported at runtime.
return value.astype(object).where(value.notna(), None) # type: ignore[call-overload,no-any-return]

@staticmethod
def _normalize_pandas_series_nulls(value: pd.Series) -> pd.Series:
"""Convert pandas null sentinels into Python None for output handling."""
return value.astype(object).where(value.notna(), None)
# pandas-stubs rejects None as the `other` arg of where(), but it is supported at runtime.
return value.astype(object).where(value.notna(), None) # type: ignore[call-overload,no-any-return]

@staticmethod
def python_type_to_schema_type(python_type: str) -> str:
Expand Down