@@ -2077,7 +2077,7 @@ def test_series_string_inference(self):
2077
2077
# GH#54430
2078
2078
with pd .option_context ("future.infer_string" , True ):
2079
2079
ser = Series (["a" , "b" ])
2080
- dtype = "string[pyarrow_numpy] " if HAS_PYARROW else "string[python_numpy]"
2080
+ dtype = pd . StringDtype ( "pyarrow " if HAS_PYARROW else "python" , na_value = np . nan )
2081
2081
expected = Series (["a" , "b" ], dtype = dtype )
2082
2082
tm .assert_series_equal (ser , expected )
2083
2083
@@ -2091,23 +2091,23 @@ def test_series_string_with_na_inference(self, na_value):
2091
2091
# GH#54430
2092
2092
with pd .option_context ("future.infer_string" , True ):
2093
2093
ser = Series (["a" , na_value ])
2094
- dtype = "string[pyarrow_numpy] " if HAS_PYARROW else "string[python_numpy]"
2094
+ dtype = pd . StringDtype ( "pyarrow " if HAS_PYARROW else "python" , na_value = np . nan )
2095
2095
expected = Series (["a" , None ], dtype = dtype )
2096
2096
tm .assert_series_equal (ser , expected )
2097
2097
2098
2098
def test_series_string_inference_scalar (self ):
2099
2099
# GH#54430
2100
2100
with pd .option_context ("future.infer_string" , True ):
2101
2101
ser = Series ("a" , index = [1 ])
2102
- dtype = "string[pyarrow_numpy] " if HAS_PYARROW else "string[python_numpy]"
2102
+ dtype = pd . StringDtype ( "pyarrow " if HAS_PYARROW else "python" , na_value = np . nan )
2103
2103
expected = Series ("a" , index = [1 ], dtype = dtype )
2104
2104
tm .assert_series_equal (ser , expected )
2105
2105
2106
2106
def test_series_string_inference_array_string_dtype (self ):
2107
2107
# GH#54496
2108
2108
with pd .option_context ("future.infer_string" , True ):
2109
2109
ser = Series (np .array (["a" , "b" ]))
2110
- dtype = "string[pyarrow_numpy] " if HAS_PYARROW else "string[python_numpy]"
2110
+ dtype = pd . StringDtype ( "pyarrow " if HAS_PYARROW else "python" , na_value = np . nan )
2111
2111
expected = Series (["a" , "b" ], dtype = dtype )
2112
2112
tm .assert_series_equal (ser , expected )
2113
2113
@@ -2134,7 +2134,7 @@ def test_series_string_inference_na_first(self):
2134
2134
# GH#55655
2135
2135
with pd .option_context ("future.infer_string" , True ):
2136
2136
result = Series ([pd .NA , "b" ])
2137
- dtype = "string[pyarrow_numpy] " if HAS_PYARROW else "string[python_numpy]"
2137
+ dtype = pd . StringDtype ( "pyarrow " if HAS_PYARROW else "python" , na_value = np . nan )
2138
2138
expected = Series ([None , "b" ], dtype = dtype )
2139
2139
tm .assert_series_equal (result , expected )
2140
2140
0 commit comments