Skip to content

Commit 8e65078

Browse files
committed
Revert test_strings.py changes and remove accidental whatsnew file
1 parent 76f741c commit 8e65078

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

pandas/tests/strings/test_find_replace.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,21 @@ def test_contains_nan(any_string_dtype):
282282

283283

284284
def test_str_contains_compiled_regex_arrow_dtype(any_string_dtype):
285+
# GH#61942
285286
ser = Series(["foo", "bar", "baz"], dtype=any_string_dtype)
286287
pat = re.compile("ba.")
287288
result = ser.str.contains(pat)
288-
assert str(result.dtype) == "bool[pyarrow]"
289-
expected = Series([False, True, True], dtype="bool[pyarrow]")
289+
# Determine expected dtype and values
290+
if any_string_dtype == "string[pyarrow]":
291+
expected_dtype = "bool[pyarrow]"
292+
elif any_string_dtype == "string":
293+
expected_dtype = "boolean"
294+
elif any_string_dtype == "str":
295+
expected_dtype = bool
296+
else:
297+
expected_dtype = object
298+
expected = Series([False, True, True], dtype=expected_dtype)
299+
assert str(result.dtype) == str(expected.dtype)
290300
tm.assert_series_equal(result, expected)
291301

292302

0 commit comments

Comments
 (0)