@@ -516,50 +516,34 @@ def test_arrow_array(dtype):
516516 assert arr .equals (expected )
517517
518518
519- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
519+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
520520@pytest .mark .filterwarnings ("ignore:Passing a BlockManager:DeprecationWarning" )
521- def test_arrow_roundtrip (dtype , string_storage2 , request , using_infer_string ):
521+ def test_arrow_roundtrip (dtype , string_storage , using_infer_string ):
522522 # roundtrip possible from arrow 1.0.0
523523 pa = pytest .importorskip ("pyarrow" )
524524
525- if using_infer_string and string_storage2 != "pyarrow_numpy" :
526- request .applymarker (
527- pytest .mark .xfail (
528- reason = "infer_string takes precedence over string storage"
529- )
530- )
531-
532525 data = pd .array (["a" , "b" , None ], dtype = dtype )
533526 df = pd .DataFrame ({"a" : data })
534527 table = pa .table (df )
535528 if dtype .storage == "python" :
536529 assert table .field ("a" ).type == "string"
537530 else :
538531 assert table .field ("a" ).type == "large_string"
539- with pd .option_context ("string_storage" , string_storage2 ):
532+ with pd .option_context ("string_storage" , string_storage ):
540533 result = table .to_pandas ()
541534 assert isinstance (result ["a" ].dtype , pd .StringDtype )
542- expected = df .astype (f"string[{ string_storage2 } ]" )
535+ expected = df .astype (f"string[{ string_storage } ]" )
543536 tm .assert_frame_equal (result , expected )
544537 # ensure the missing value is represented by NA and not np.nan or None
545538 assert result .loc [2 , "a" ] is result ["a" ].dtype .na_value
546539
547540
548- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
541+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
549542@pytest .mark .filterwarnings ("ignore:Passing a BlockManager:DeprecationWarning" )
550- def test_arrow_load_from_zero_chunks (
551- dtype , string_storage2 , request , using_infer_string
552- ):
543+ def test_arrow_load_from_zero_chunks (dtype , string_storage , using_infer_string ):
553544 # GH-41040
554545 pa = pytest .importorskip ("pyarrow" )
555546
556- if using_infer_string and string_storage2 != "pyarrow_numpy" :
557- request .applymarker (
558- pytest .mark .xfail (
559- reason = "infer_string takes precedence over string storage"
560- )
561- )
562-
563547 data = pd .array ([], dtype = dtype )
564548 df = pd .DataFrame ({"a" : data })
565549 table = pa .table (df )
@@ -569,10 +553,10 @@ def test_arrow_load_from_zero_chunks(
569553 assert table .field ("a" ).type == "large_string"
570554 # Instantiate the same table with no chunks at all
571555 table = pa .table ([pa .chunked_array ([], type = pa .string ())], schema = table .schema )
572- with pd .option_context ("string_storage" , string_storage2 ):
556+ with pd .option_context ("string_storage" , string_storage ):
573557 result = table .to_pandas ()
574558 assert isinstance (result ["a" ].dtype , pd .StringDtype )
575- expected = df .astype (f"string[{ string_storage2 } ]" )
559+ expected = df .astype (f"string[{ string_storage } ]" )
576560 tm .assert_frame_equal (result , expected )
577561
578562
0 commit comments