Skip to content

Commit

Permalink
fix nulls in pandas columns on default cards (#1606)
Browse files Browse the repository at this point in the history
* fix nulls in pandas columns on default cards

* Update metaflow/plugins/cards/card_modules/convert_to_native_type.py

Co-authored-by: Valay Dave <[email protected]>

* replace nulls before calling truncate_long_objects

---------

Co-authored-by: Adam Merberg <[email protected]>
Co-authored-by: Valay Dave <[email protected]>
  • Loading branch information
3 people authored Oct 26, 2023
1 parent d8ad275 commit c8ca6ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions metaflow/plugins/cards/card_modules/convert_to_native_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ def _match_partial_type():
try:
col_type = str(column_object.dtype)
if col_type in type_parser:
return type_parser[col_type](column_object)
return type_parser[col_type](column_object.fillna("null"))
else:
parsed_col = _match_partial_type()
if parsed_col is not None:
return parsed_col
return truncate_long_objects(column_object)
return parsed_col.fillna("null")
return truncate_long_objects(column_object.fillna("null"))
except ValueError as e:
return "Unsupported type: {0}".format(col_type)
except TypeError as e:
Expand Down

0 comments on commit c8ca6ab

Please sign in to comment.