diff --git a/pandas/tests/arrays/period/test_arrow_compat.py b/pandas/tests/arrays/period/test_arrow_compat.py index bb41b564f6db0..6441b188a69c5 100644 --- a/pandas/tests/arrays/period/test_arrow_compat.py +++ b/pandas/tests/arrays/period/test_arrow_compat.py @@ -11,6 +11,11 @@ period_array, ) +pytestmark = pytest.mark.filterwarnings( + "ignore:Passing a BlockManager to DataFrame:DeprecationWarning" +) + + pa = pytest.importorskip("pyarrow") @@ -81,16 +86,12 @@ def test_arrow_table_roundtrip(): table = pa.table(df) assert isinstance(table.field("a").type, ArrowPeriodType) - msg = "Passing a BlockManager to DataFrame is deprecated" - with tm.assert_produces_warning(DeprecationWarning, match=msg): - result = table.to_pandas() + result = table.to_pandas() assert isinstance(result["a"].dtype, PeriodDtype) tm.assert_frame_equal(result, df) table2 = pa.concat_tables([table, table]) - msg = "Passing a BlockManager to DataFrame is deprecated" - with tm.assert_produces_warning(DeprecationWarning, match=msg): - result = table2.to_pandas() + result = table2.to_pandas() expected = pd.concat([df, df], ignore_index=True) tm.assert_frame_equal(result, expected) @@ -109,9 +110,7 @@ def test_arrow_load_from_zero_chunks(): [pa.chunked_array([], type=table.column(0).type)], schema=table.schema ) - msg = "Passing a BlockManager to DataFrame is deprecated" - with tm.assert_produces_warning(DeprecationWarning, match=msg): - result = table.to_pandas() + result = table.to_pandas() assert isinstance(result["a"].dtype, PeriodDtype) tm.assert_frame_equal(result, df) @@ -126,8 +125,6 @@ def test_arrow_table_roundtrip_without_metadata(): table = table.replace_schema_metadata() assert table.schema.metadata is None - msg = "Passing a BlockManager to DataFrame is deprecated" - with tm.assert_produces_warning(DeprecationWarning, match=msg): - result = table.to_pandas() + result = table.to_pandas() assert isinstance(result["a"].dtype, PeriodDtype) tm.assert_frame_equal(result, df) diff --git a/pandas/tests/io/parser/test_parse_dates.py b/pandas/tests/io/parser/test_parse_dates.py index 1e8f4ed3a3b16..565626e35dc60 100644 --- a/pandas/tests/io/parser/test_parse_dates.py +++ b/pandas/tests/io/parser/test_parse_dates.py @@ -2230,14 +2230,9 @@ def test_parse_dates_dict_format_two_columns(all_parsers, key, parse_dates): 31-,12-2019 31-,12-2020""" - warn = None - if parser.engine == "pyarrow": - warn = DeprecationWarning - msg = "Passing a BlockManager to DataFrame is deprecated" - with tm.assert_produces_warning(warn, match=msg, check_stacklevel=False): - result = parser.read_csv( - StringIO(data), date_format={key: "%d- %m-%Y"}, parse_dates=parse_dates - ) + result = parser.read_csv( + StringIO(data), date_format={key: "%d- %m-%Y"}, parse_dates=parse_dates + ) expected = DataFrame( { key: [Timestamp("2019-12-31"), Timestamp("2020-12-31")],