Skip to content

Commit

Permalink
Merge pull request #408 from Renumics/bug/fix-na_mask
Browse files Browse the repository at this point in the history
🐛 Fix pandas data source error if no nan values in column
  • Loading branch information
neindochoh authored Feb 1, 2024
2 parents d601191 + 527e0fa commit 17bd7fc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions renumics/spotlight_plugins/core/pandas_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,20 @@ def get_column_values(
if pd.api.types.is_bool_dtype(column):
values = column.to_numpy()
na_mask = column.isna()
values[na_mask] = None
if na_mask.any():
values[na_mask] = None
return values
if pd.api.types.is_integer_dtype(column):
values = column.to_numpy()
na_mask = column.isna()
values[na_mask] = None
if na_mask.any():
values[na_mask] = None
return values
if pd.api.types.is_float_dtype(column):
values = column.to_numpy()
na_mask = column.isna()
values[na_mask] = None
if na_mask.any():
values[na_mask] = None
return values
if pd.api.types.is_datetime64_any_dtype(column):
return column.dt.tz_localize(None).to_numpy()
Expand Down

0 comments on commit 17bd7fc

Please sign in to comment.