diff --git a/extensions/positron-python/pythonFiles/positron/positron_ipykernel/data_explorer.py b/extensions/positron-python/pythonFiles/positron/positron_ipykernel/data_explorer.py index b920b93a76e..05eccba168b 100644 --- a/extensions/positron-python/pythonFiles/positron/positron_ipykernel/data_explorer.py +++ b/extensions/positron-python/pythonFiles/positron/positron_ipykernel/data_explorer.py @@ -297,10 +297,6 @@ def __init__( # performance. self._search_schema_last_result: Optional[Tuple[str, List[ColumnSchema]]] = None - # squelch a warning from pandas 2.2.0 about the use below of - # fillna - pd_.set_option("future.no_silent_downcasting", True) - # Putting this here rather than in the class body before # Python < 3.10 has fussier rules about staticmethods self._SUMMARIZERS = { @@ -560,9 +556,12 @@ def _eval_filter(self, filt: RowFilter): elif params.type == SearchFilterParamsType.EndsWith: mask = col.str.endswith(term) + assert mask is not None + # Nulls are possible in the mask, so we just fill them if any if mask.dtype != bool: - mask = mask.fillna(False).infer_objects(copy=False) + mask[mask.isna()] = False + mask = mask.astype(bool) return mask.to_numpy() diff --git a/extensions/positron-python/pythonFiles/positron/positron_ipykernel/tests/test_data_explorer.py b/extensions/positron-python/pythonFiles/positron/positron_ipykernel/tests/test_data_explorer.py index 6da925b861d..26c04fb157b 100644 --- a/extensions/positron-python/pythonFiles/positron/positron_ipykernel/tests/test_data_explorer.py +++ b/extensions/positron-python/pythonFiles/positron/positron_ipykernel/tests/test_data_explorer.py @@ -832,7 +832,8 @@ def test_pandas_filter_search(dxf: DataExplorerFixture): ] for search_type, column_index, term, cs, mask in cases: - ex_table = df[mask.fillna(False)] + mask[mask.isna()] = False + ex_table = df[mask.astype(bool)] dxf.check_filter_case( df, [