MCPcopy Create free account
hub / github.com/apache/arrow / test_read_feather_v1_no_double_warning

Function test_read_feather_v1_no_double_warning

python/pyarrow/tests/test_feather.py:911–923  ·  view source on GitHub ↗

Verify reading a V1 file emits one DeprecationWarning, not two.

(tempdir)

Source from the content-addressed store, hash-verified

909@pytest.mark.pandas
910@pytest.mark.filterwarnings("default:Feather V1:DeprecationWarning")
911def test_read_feather_v1_no_double_warning(tempdir):
912 """Verify reading a V1 file emits one DeprecationWarning, not two."""
913 table = pa.table({"a": [1, 2, 3]})
914 path = str(tempdir / "test.feather")
915 with warnings.catch_warnings():
916 warnings.simplefilter("ignore", DeprecationWarning)
917 write_feather(table, path, version=1)
918 with warnings.catch_warnings(record=True) as w:
919 warnings.simplefilter("always")
920 read_feather(path)
921 v1_warnings = [x for x in w if issubclass(x.category,
922 DeprecationWarning)]
923 assert len(v1_warnings) == 1

Callers

nothing calls this directly

Calls 3

write_featherFunction · 0.90
read_featherFunction · 0.90
lenFunction · 0.85

Tested by

no test coverage detected