Skip to content

Commit 966f43a

Browse files
committed
Fix test_str_contains_compiled_regex_arrow_dtype to properly handle dtype expectations
1 parent da5f363 commit 966f43a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/tests/strings/test_find_replace.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ def test_str_contains_compiled_regex_arrow_dtype(any_string_dtype):
287287
pat = re.compile("ba.")
288288
result = ser.str.contains(pat)
289289

290-
expected = Series([False, True, True], dtype=bool)
290+
expected_dtype = (
291+
np.bool_ if is_object_or_nan_string_dtype(any_string_dtype) else "boolean"
292+
)
293+
expected = Series([False, True, True], dtype=expected_dtype)
291294
tm.assert_series_equal(result, expected)
292295

293296

0 commit comments

Comments
 (0)