Skip to content

Commit 5d51d14

Browse files
author
Piyush Kanti Chanda
committed
Address review: move deprecated directive, merge deprecation tests
- Move `.. deprecated::` after `.. currentmodule::` in formats.rst - Merge write_feather, read_table, read_feather deprecation tests into a single test_feather_deprecation_warnings function Co-authored-by: Isaac
1 parent b673a6a commit 5d51d14

2 files changed

Lines changed: 7 additions & 21 deletions

File tree

docs/source/python/api/formats.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ CSV Files
4545
Feather Files (Deprecated)
4646
--------------------------
4747

48+
.. currentmodule:: pyarrow.feather
49+
4850
.. deprecated:: 24.0.0
4951
The Feather API is deprecated. Use the :ref:`IPC <ipc>` API instead.
5052

51-
.. currentmodule:: pyarrow.feather
52-
5353
.. autosummary::
5454
:toctree: ../generated/
5555

python/pyarrow/tests/test_feather.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -893,32 +893,18 @@ def test_feather_datetime_resolution_arrow_to_pandas(tempdir):
893893

894894
# --- Deprecation warning tests ---
895895

896+
@pytest.mark.pandas
896897
@pytest.mark.filterwarnings("default:pyarrow.feather:FutureWarning")
897-
def test_write_feather_deprecated(tempdir):
898-
table = pa.table({"a": [1, 2, 3]})
899-
with pytest.warns(FutureWarning, match="write_feather is deprecated"):
900-
write_feather(table, str(tempdir / "test.feather"))
901-
902-
903-
@pytest.mark.filterwarnings("default:pyarrow.feather:FutureWarning")
904-
def test_read_table_deprecated(tempdir):
898+
def test_feather_deprecation_warnings(tempdir):
905899
table = pa.table({"a": [1, 2, 3]})
906900
path = str(tempdir / "test.feather")
907-
with warnings.catch_warnings():
908-
warnings.simplefilter("ignore", FutureWarning)
901+
902+
with pytest.warns(FutureWarning, match="write_feather is deprecated"):
909903
write_feather(table, path)
904+
910905
with pytest.warns(FutureWarning, match="read_table is deprecated"):
911906
read_table(path)
912907

913-
914-
@pytest.mark.pandas
915-
@pytest.mark.filterwarnings("default:pyarrow.feather:FutureWarning")
916-
def test_read_feather_deprecated(tempdir):
917-
table = pa.table({"a": [1, 2, 3]})
918-
path = str(tempdir / "test.feather")
919-
with warnings.catch_warnings():
920-
warnings.simplefilter("ignore", FutureWarning)
921-
write_feather(table, path)
922908
with pytest.warns(FutureWarning, match="read_feather is deprecated"):
923909
read_feather(path)
924910

0 commit comments

Comments
 (0)