@@ -514,50 +514,34 @@ def test_arrow_array(dtype):
514
514
assert arr .equals (expected )
515
515
516
516
517
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
517
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
518
518
@pytest .mark .filterwarnings ("ignore:Passing a BlockManager:DeprecationWarning" )
519
- def test_arrow_roundtrip (dtype , string_storage2 , request , using_infer_string ):
519
+ def test_arrow_roundtrip (dtype , string_storage , using_infer_string ):
520
520
# roundtrip possible from arrow 1.0.0
521
521
pa = pytest .importorskip ("pyarrow" )
522
522
523
- if using_infer_string and string_storage2 != "pyarrow_numpy" :
524
- request .applymarker (
525
- pytest .mark .xfail (
526
- reason = "infer_string takes precedence over string storage"
527
- )
528
- )
529
-
530
523
data = pd .array (["a" , "b" , None ], dtype = dtype )
531
524
df = pd .DataFrame ({"a" : data })
532
525
table = pa .table (df )
533
526
if dtype .storage == "python" :
534
527
assert table .field ("a" ).type == "string"
535
528
else :
536
529
assert table .field ("a" ).type == "large_string"
537
- with pd .option_context ("string_storage" , string_storage2 ):
530
+ with pd .option_context ("string_storage" , string_storage ):
538
531
result = table .to_pandas ()
539
532
assert isinstance (result ["a" ].dtype , pd .StringDtype )
540
- expected = df .astype (f"string[{ string_storage2 } ]" )
533
+ expected = df .astype (f"string[{ string_storage } ]" )
541
534
tm .assert_frame_equal (result , expected )
542
535
# ensure the missing value is represented by NA and not np.nan or None
543
536
assert result .loc [2 , "a" ] is result ["a" ].dtype .na_value
544
537
545
538
546
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
539
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
547
540
@pytest .mark .filterwarnings ("ignore:Passing a BlockManager:DeprecationWarning" )
548
- def test_arrow_load_from_zero_chunks (
549
- dtype , string_storage2 , request , using_infer_string
550
- ):
541
+ def test_arrow_load_from_zero_chunks (dtype , string_storage , using_infer_string ):
551
542
# GH-41040
552
543
pa = pytest .importorskip ("pyarrow" )
553
544
554
- if using_infer_string and string_storage2 != "pyarrow_numpy" :
555
- request .applymarker (
556
- pytest .mark .xfail (
557
- reason = "infer_string takes precedence over string storage"
558
- )
559
- )
560
-
561
545
data = pd .array ([], dtype = dtype )
562
546
df = pd .DataFrame ({"a" : data })
563
547
table = pa .table (df )
@@ -567,10 +551,10 @@ def test_arrow_load_from_zero_chunks(
567
551
assert table .field ("a" ).type == "large_string"
568
552
# Instantiate the same table with no chunks at all
569
553
table = pa .table ([pa .chunked_array ([], type = pa .string ())], schema = table .schema )
570
- with pd .option_context ("string_storage" , string_storage2 ):
554
+ with pd .option_context ("string_storage" , string_storage ):
571
555
result = table .to_pandas ()
572
556
assert isinstance (result ["a" ].dtype , pd .StringDtype )
573
- expected = df .astype (f"string[{ string_storage2 } ]" )
557
+ expected = df .astype (f"string[{ string_storage } ]" )
574
558
tm .assert_frame_equal (result , expected )
575
559
576
560
0 commit comments