Skip to content

Commit 864c166

Browse files
remove all python_numpy usage
1 parent cbd0820 commit 864c166

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

pandas/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,6 @@ def nullable_string_dtype(request):
12951295
@pytest.fixture(
12961296
params=[
12971297
"python",
1298-
"python_numpy",
12991298
pytest.param("pyarrow", marks=td.skip_if_no("pyarrow")),
13001299
]
13011300
)
@@ -1314,6 +1313,7 @@ def string_storage(request):
13141313
("python", pd.NA),
13151314
pytest.param(("pyarrow", pd.NA), marks=td.skip_if_no("pyarrow")),
13161315
pytest.param(("pyarrow", np.nan), marks=td.skip_if_no("pyarrow")),
1316+
("python", np.nan),
13171317
]
13181318
)
13191319
def string_dtype_arguments(request):

pandas/core/arrays/string_.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,6 @@ def __init__(
146146
# TODO raise a deprecation warning
147147
storage = "pyarrow"
148148
na_value = np.nan
149-
if storage == "python_numpy":
150-
# TODO remove
151-
storage = "python"
152-
na_value = np.nan
153149

154150
# validate options
155151
if storage not in {"python", "pyarrow"}:
@@ -234,9 +230,6 @@ def construct_from_string(cls, string) -> Self:
234230
return cls()
235231
elif string == "string[python]":
236232
return cls(storage="python")
237-
elif string == "string[python_numpy]":
238-
# TODO remove
239-
return cls(storage="python", na_value=np.nan)
240233
elif string == "string[pyarrow]":
241234
return cls(storage="pyarrow")
242235
elif string == "string[pyarrow_numpy]":

pandas/tests/strings/test_find_replace.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,14 @@ def test_contains_nan(any_string_dtype):
232232
expected = Series([True, True, True], dtype=expected_dtype)
233233
tm.assert_series_equal(result, expected)
234234

235-
if any_string_dtype == "string[python_numpy]":
236-
with pytest.raises(TypeError):
237-
result = s.str.contains("foo", na="foo")
235+
result = s.str.contains("foo", na="foo")
236+
if any_string_dtype == "object":
237+
expected = Series(["foo", "foo", "foo"], dtype=np.object_)
238+
elif any_string_dtype.na_value is np.nan:
239+
expected = Series([True, True, True], dtype=np.bool_)
238240
else:
239-
result = s.str.contains("foo", na="foo")
240-
if any_string_dtype == "object":
241-
expected = Series(["foo", "foo", "foo"], dtype=np.object_)
242-
elif any_string_dtype == "string[pyarrow_numpy]":
243-
expected = Series([True, True, True], dtype=np.bool_)
244-
else:
245-
expected = Series([True, True, True], dtype="boolean")
246-
tm.assert_series_equal(result, expected)
241+
expected = Series([True, True, True], dtype="boolean")
242+
tm.assert_series_equal(result, expected)
247243

248244
result = s.str.contains("foo")
249245
expected_dtype = (

0 commit comments

Comments
 (0)