@@ -1955,13 +1955,11 @@ def test_adding_new_conditional_column() -> None:
19551955 ("dtype" , "infer_string" ),
19561956 [
19571957 (object , False ),
1958- ("string[pyarrow_numpy]" , True ),
1958+ (pd . StringDtype ( na_value = np . nan ) , True ),
19591959 ],
19601960)
19611961def test_adding_new_conditional_column_with_string (dtype , infer_string ) -> None :
19621962 # https://github.com/pandas-dev/pandas/issues/56204
1963- pytest .importorskip ("pyarrow" )
1964-
19651963 df = DataFrame ({"a" : [1 , 2 ], "b" : [3 , 4 ]})
19661964 with pd .option_context ("future.infer_string" , infer_string ):
19671965 df .loc [df ["a" ] == 1 , "c" ] = "1"
@@ -1971,16 +1969,14 @@ def test_adding_new_conditional_column_with_string(dtype, infer_string) -> None:
19711969 tm .assert_frame_equal (df , expected )
19721970
19731971
1974- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
19751972def test_add_new_column_infer_string ():
19761973 # GH#55366
1977- pytest .importorskip ("pyarrow" )
19781974 df = DataFrame ({"x" : [1 ]})
19791975 with pd .option_context ("future.infer_string" , True ):
19801976 df .loc [df ["x" ] == 1 , "y" ] = "1"
19811977 expected = DataFrame (
1982- {"x" : [1 ], "y" : Series (["1" ], dtype = "string[pyarrow_numpy]" )},
1983- columns = Index (["x" , "y" ], dtype = object ),
1978+ {"x" : [1 ], "y" : Series (["1" ], dtype = pd . StringDtype ( na_value = np . nan ) )},
1979+ columns = Index (["x" , "y" ], dtype = "str" ),
19841980 )
19851981 tm .assert_frame_equal (df , expected )
19861982
0 commit comments