Skip to content

Commit 05ae24f

Browse files
committed
BUG: Fix Series.str.contains with compiled regex on Arrow string dtype (#61942) and add whatsnew note
1 parent 6768fb1 commit 05ae24f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/arrays/string_arrow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ def _str_contains(
344344
na=lib.no_default,
345345
regex: bool = True,
346346
):
347-
if regex and (isinstance(pat, re.Pattern) or flags):
348-
return super()._str_contains(pat, case, flags, na, regex)
347+
if isinstance(pat, re.Pattern):
348+
pat = pat.pattern
349349

350350
return ArrowStringArrayMixin._str_contains(self, pat, case, flags, na, regex)
351351

0 commit comments

Comments
 (0)