From 99015493e66df320747db973277d16e9085b9021 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 22 Mar 2021 14:31:02 +0100 Subject: [PATCH] DEPR: use DeprecationWarning instead of FutureWarning for CategoricalBlock --- pandas/core/internals/__init__.py | 2 +- pandas/tests/io/test_common.py | 4 +++- pandas/tests/io/test_feather.py | 2 +- pandas/tests/io/test_parquet.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pandas/core/internals/__init__.py b/pandas/core/internals/__init__.py index 1be8df2fabfd4..18e584575bc97 100644 --- a/pandas/core/internals/__init__.py +++ b/pandas/core/internals/__init__.py @@ -53,7 +53,7 @@ def __getattr__(name: str): warnings.warn( "CategoricalBlock is deprecated and will be removed in a future version. " "Use ExtensionBlock instead.", - FutureWarning, + DeprecationWarning, stacklevel=2, ) return ExtensionBlock diff --git a/pandas/tests/io/test_common.py b/pandas/tests/io/test_common.py index 21d55e40a07fb..d882eb930137b 100644 --- a/pandas/tests/io/test_common.py +++ b/pandas/tests/io/test_common.py @@ -258,7 +258,9 @@ def test_read_expands_user_home_dir( ), ], ) - @pytest.mark.filterwarnings("ignore:CategoricalBlock is deprecated:FutureWarning") + @pytest.mark.filterwarnings( + "ignore:CategoricalBlock is deprecated:DeprecationWarning" + ) def test_read_fspath_all(self, reader, module, path, datapath): pytest.importorskip(module) path = datapath(*path) diff --git a/pandas/tests/io/test_feather.py b/pandas/tests/io/test_feather.py index 162094428dbc0..81af799640135 100644 --- a/pandas/tests/io/test_feather.py +++ b/pandas/tests/io/test_feather.py @@ -20,7 +20,7 @@ @filter_sparse @pytest.mark.single -@pytest.mark.filterwarnings("ignore:CategoricalBlock is deprecated:FutureWarning") +@pytest.mark.filterwarnings("ignore:CategoricalBlock is deprecated:DeprecationWarning") class TestFeather: def check_error_on_write(self, df, exc, err_msg): # check that we are raising the exception diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index f3cfa033409cb..e74c915bbaf74 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -573,7 +573,7 @@ def test_write_column_index_nonstring(self, pa): self.check_error_on_write(df, engine, ValueError, msg) -@pytest.mark.filterwarnings("ignore:CategoricalBlock is deprecated:FutureWarning") +@pytest.mark.filterwarnings("ignore:CategoricalBlock is deprecated:DeprecationWarning") class TestParquetPyArrow(Base): def test_basic(self, pa, df_full):