7575def test_orc ():
7676 with ensure_clean () as path :
7777 check (assert_type (DF .to_orc (path ), None ), type (None ))
78- check (assert_type (read_orc (path ), DataFrame ), DataFrame )
78+ with pytest_warns_bounded (
79+ DeprecationWarning ,
80+ "Passing a BlockManager to DataFrame is deprecated" ,
81+ lower = "2.1.99" ,
82+ ):
83+ check (assert_type (read_orc (path ), DataFrame ), DataFrame )
7984
8085
8186@pytest .mark .skipif (WINDOWS , reason = "ORC not available on windows" )
8287def test_orc_path ():
8388 with ensure_clean () as path :
8489 pathlib_path = Path (path )
8590 check (assert_type (DF .to_orc (pathlib_path ), None ), type (None ))
86- check (assert_type (read_orc (pathlib_path ), DataFrame ), DataFrame )
91+ with pytest_warns_bounded (
92+ DeprecationWarning ,
93+ "Passing a BlockManager to DataFrame is deprecated" ,
94+ lower = "2.1.99" ,
95+ ):
96+ check (assert_type (read_orc (pathlib_path ), DataFrame ), DataFrame )
8797
8898
8999@pytest .mark .skipif (WINDOWS , reason = "ORC not available on windows" )
@@ -93,14 +103,24 @@ def test_orc_buffer():
93103 check (assert_type (DF .to_orc (file_w ), None ), type (None ))
94104
95105 with open (path , "rb" ) as file_r :
96- check (assert_type (read_orc (file_r ), DataFrame ), DataFrame )
106+ with pytest_warns_bounded (
107+ DeprecationWarning ,
108+ "Passing a BlockManager to DataFrame is deprecated" ,
109+ lower = "2.1.99" ,
110+ ):
111+ check (assert_type (read_orc (file_r ), DataFrame ), DataFrame )
97112
98113
99114@pytest .mark .skipif (WINDOWS , reason = "ORC not available on windows" )
100115def test_orc_columns ():
101116 with ensure_clean () as path :
102117 check (assert_type (DF .to_orc (path , index = False ), None ), type (None ))
103- check (assert_type (read_orc (path , columns = ["a" ]), DataFrame ), DataFrame )
118+ with pytest_warns_bounded (
119+ DeprecationWarning ,
120+ "Passing a BlockManager to DataFrame is deprecated" ,
121+ lower = "2.1.99" ,
122+ ):
123+ check (assert_type (read_orc (path , columns = ["a" ]), DataFrame ), DataFrame )
104124
105125
106126@pytest .mark .skipif (WINDOWS , reason = "ORC not available on windows" )
@@ -524,7 +544,12 @@ def test_parquet():
524544 with ensure_clean () as path :
525545 check (assert_type (DF .to_parquet (path ), None ), type (None ))
526546 check (assert_type (DF .to_parquet (), bytes ), bytes )
527- check (assert_type (read_parquet (path ), DataFrame ), DataFrame )
547+ with pytest_warns_bounded (
548+ DeprecationWarning ,
549+ "Passing a BlockManager to DataFrame is deprecated" ,
550+ lower = "2.1.99" ,
551+ ):
552+ check (assert_type (read_parquet (path ), DataFrame ), DataFrame )
528553
529554
530555def test_parquet_options ():
@@ -533,18 +558,33 @@ def test_parquet_options():
533558 assert_type (DF .to_parquet (path , compression = None , index = True ), None ),
534559 type (None ),
535560 )
536- check (assert_type (read_parquet (path ), DataFrame ), DataFrame )
561+ with pytest_warns_bounded (
562+ DeprecationWarning ,
563+ "Passing a BlockManager to DataFrame is deprecated" ,
564+ lower = "2.1.99" ,
565+ ):
566+ check (assert_type (read_parquet (path ), DataFrame ), DataFrame )
537567
538568
539569def test_feather ():
540570 with ensure_clean () as path :
541571 check (assert_type (DF .to_feather (path ), None ), type (None ))
542- check (assert_type (read_feather (path ), DataFrame ), DataFrame )
543- check (assert_type (read_feather (path , columns = ["a" ]), DataFrame ), DataFrame )
572+ with pytest_warns_bounded (
573+ DeprecationWarning ,
574+ "Passing a BlockManager to DataFrame is deprecated" ,
575+ lower = "2.1.99" ,
576+ ):
577+ check (assert_type (read_feather (path ), DataFrame ), DataFrame )
578+ check (assert_type (read_feather (path , columns = ["a" ]), DataFrame ), DataFrame )
544579 with io .BytesIO () as bio :
545580 check (assert_type (DF .to_feather (bio ), None ), type (None ))
546581 bio .seek (0 )
547- check (assert_type (read_feather (bio ), DataFrame ), DataFrame )
582+ with pytest_warns_bounded (
583+ DeprecationWarning ,
584+ "Passing a BlockManager to DataFrame is deprecated" ,
585+ lower = "2.1.99" ,
586+ ):
587+ check (assert_type (read_feather (bio ), DataFrame ), DataFrame )
548588
549589
550590def test_read_csv ():
@@ -1394,25 +1434,42 @@ def test_all_read_without_lxml_dtype_backend() -> None:
13941434
13951435 if not WINDOWS :
13961436 check (assert_type (DF .to_orc (path ), None ), type (None ))
1437+ with pytest_warns_bounded (
1438+ DeprecationWarning ,
1439+ "Passing a BlockManager to DataFrame is deprecated" ,
1440+ lower = "2.1.99" ,
1441+ ):
1442+ check (
1443+ assert_type (
1444+ read_orc (path , dtype_backend = "numpy_nullable" ), DataFrame
1445+ ),
1446+ DataFrame ,
1447+ )
1448+ check (assert_type (DF .to_feather (path ), None ), type (None ))
1449+ with pytest_warns_bounded (
1450+ DeprecationWarning ,
1451+ "Passing a BlockManager to DataFrame is deprecated" ,
1452+ lower = "2.1.99" ,
1453+ ):
13971454 check (
1398- assert_type (read_orc (path , dtype_backend = "numpy_nullable " ), DataFrame ),
1455+ assert_type (read_feather (path , dtype_backend = "pyarrow " ), DataFrame ),
13991456 DataFrame ,
14001457 )
1401- check (assert_type (DF .to_feather (path ), None ), type (None ))
1402- check (
1403- assert_type (read_feather (path , dtype_backend = "pyarrow" ), DataFrame ),
1404- DataFrame ,
1405- )
14061458
1407- check (
1408- assert_type (
1409- pd .to_numeric (
1410- [1.0 , 2.0 , "blerg" ], errors = "ignore" , dtype_backend = "numpy_nullable"
1459+ with pytest_warns_bounded (
1460+ FutureWarning , "errors='ignore' is deprecated" , lower = "2.1.99"
1461+ ):
1462+ check (
1463+ assert_type (
1464+ pd .to_numeric (
1465+ [1.0 , 2.0 , "blerg" ],
1466+ errors = "ignore" ,
1467+ dtype_backend = "numpy_nullable" ,
1468+ ),
1469+ npt .NDArray ,
14111470 ),
1412- npt .NDArray ,
1413- ),
1414- np .ndarray ,
1415- )
1471+ np .ndarray ,
1472+ )
14161473
14171474 with ensure_clean (".xlsx" ) as path :
14181475 as_str : str = path
0 commit comments