@@ -1864,13 +1864,11 @@ def test_adding_new_conditional_column() -> None:
18641864 ("dtype" , "infer_string" ),
18651865 [
18661866 (object , False ),
1867- ("string[pyarrow_numpy]" , True ),
1867+ (pd . StringDtype ( na_value = np . nan ) , True ),
18681868 ],
18691869)
18701870def test_adding_new_conditional_column_with_string (dtype , infer_string ) -> None :
18711871 # https://github.com/pandas-dev/pandas/issues/56204
1872- pytest .importorskip ("pyarrow" )
1873-
18741872 df = DataFrame ({"a" : [1 , 2 ], "b" : [3 , 4 ]})
18751873 with pd .option_context ("future.infer_string" , infer_string ):
18761874 df .loc [df ["a" ] == 1 , "c" ] = "1"
@@ -1880,16 +1878,14 @@ def test_adding_new_conditional_column_with_string(dtype, infer_string) -> None:
18801878 tm .assert_frame_equal (df , expected )
18811879
18821880
1883- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
18841881def test_add_new_column_infer_string ():
18851882 # GH#55366
1886- pytest .importorskip ("pyarrow" )
18871883 df = DataFrame ({"x" : [1 ]})
18881884 with pd .option_context ("future.infer_string" , True ):
18891885 df .loc [df ["x" ] == 1 , "y" ] = "1"
18901886 expected = DataFrame (
1891- {"x" : [1 ], "y" : Series (["1" ], dtype = "string[pyarrow_numpy]" )},
1892- columns = Index (["x" , "y" ], dtype = object ),
1887+ {"x" : [1 ], "y" : Series (["1" ], dtype = pd . StringDtype ( na_value = np . nan ) )},
1888+ columns = Index (["x" , "y" ], dtype = "str" ),
18931889 )
18941890 tm .assert_frame_equal (df , expected )
18951891
0 commit comments