@@ -516,50 +516,34 @@ def test_arrow_array(dtype):
516
516
assert arr .equals (expected )
517
517
518
518
519
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
519
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
520
520
@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 ):
522
522
# roundtrip possible from arrow 1.0.0
523
523
pa = pytest .importorskip ("pyarrow" )
524
524
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
-
532
525
data = pd .array (["a" , "b" , None ], dtype = dtype )
533
526
df = pd .DataFrame ({"a" : data })
534
527
table = pa .table (df )
535
528
if dtype .storage == "python" :
536
529
assert table .field ("a" ).type == "string"
537
530
else :
538
531
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 ):
540
533
result = table .to_pandas ()
541
534
assert isinstance (result ["a" ].dtype , pd .StringDtype )
542
- expected = df .astype (f"string[{ string_storage2 } ]" )
535
+ expected = df .astype (f"string[{ string_storage } ]" )
543
536
tm .assert_frame_equal (result , expected )
544
537
# ensure the missing value is represented by NA and not np.nan or None
545
538
assert result .loc [2 , "a" ] is result ["a" ].dtype .na_value
546
539
547
540
548
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
541
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
549
542
@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 ):
553
544
# GH-41040
554
545
pa = pytest .importorskip ("pyarrow" )
555
546
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
-
563
547
data = pd .array ([], dtype = dtype )
564
548
df = pd .DataFrame ({"a" : data })
565
549
table = pa .table (df )
@@ -569,10 +553,10 @@ def test_arrow_load_from_zero_chunks(
569
553
assert table .field ("a" ).type == "large_string"
570
554
# Instantiate the same table with no chunks at all
571
555
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 ):
573
557
result = table .to_pandas ()
574
558
assert isinstance (result ["a" ].dtype , pd .StringDtype )
575
- expected = df .astype (f"string[{ string_storage2 } ]" )
559
+ expected = df .astype (f"string[{ string_storage } ]" )
576
560
tm .assert_frame_equal (result , expected )
577
561
578
562
0 commit comments