@@ -524,7 +524,6 @@ def test_arrow_array(dtype):
524524 assert arr .equals (expected )
525525
526526
527- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
528527@pytest .mark .filterwarnings ("ignore:Passing a BlockManager:DeprecationWarning" )
529528def test_arrow_roundtrip (dtype , string_storage , using_infer_string ):
530529 # roundtrip possible from arrow 1.0.0
@@ -543,13 +542,16 @@ def test_arrow_roundtrip(dtype, string_storage, using_infer_string):
543542 assert result ["a" ].dtype == "object"
544543 else :
545544 assert isinstance (result ["a" ].dtype , pd .StringDtype )
546- expected = df .astype (f"string[{ string_storage } ]" )
545+ expected = df .astype (pd .StringDtype (string_storage , na_value = dtype .na_value ))
546+ if using_infer_string :
547+ expected .columns = expected .columns .astype (
548+ pd .StringDtype (string_storage , na_value = np .nan )
549+ )
547550 tm .assert_frame_equal (result , expected )
548551 # ensure the missing value is represented by NA and not np.nan or None
549552 assert result .loc [2 , "a" ] is result ["a" ].dtype .na_value
550553
551554
552- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
553555@pytest .mark .filterwarnings ("ignore:Passing a BlockManager:DeprecationWarning" )
554556def test_arrow_load_from_zero_chunks (dtype , string_storage , using_infer_string ):
555557 # GH-41040
@@ -571,7 +573,11 @@ def test_arrow_load_from_zero_chunks(dtype, string_storage, using_infer_string):
571573 assert result ["a" ].dtype == "object"
572574 else :
573575 assert isinstance (result ["a" ].dtype , pd .StringDtype )
574- expected = df .astype (f"string[{ string_storage } ]" )
576+ expected = df .astype (pd .StringDtype (string_storage , na_value = dtype .na_value ))
577+ if using_infer_string :
578+ expected .columns = expected .columns .astype (
579+ pd .StringDtype (string_storage , na_value = np .nan )
580+ )
575581 tm .assert_frame_equal (result , expected )
576582
577583
0 commit comments