Skip to content

Commit b474604

Browse files
committed
Move fix into _str_contains of ArrowExtensionArray
1 parent 324e609 commit b474604

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,8 +2447,6 @@ def _convert_rank_result(self, result):
24472447
return type(self)(result)
24482448

24492449
def _str_contains(self, pat, case=True, flags=0, na=lib.no_default, regex=True):
2450-
import re
2451-
24522450
if isinstance(pat, re.Pattern):
24532451
if flags != 0:
24542452
# fallback to python object implementation
@@ -2476,11 +2474,6 @@ def _str_count(self, pat: str, flags: int = 0) -> Self:
24762474
raise NotImplementedError(f"count not implemented with {flags=}")
24772475
return type(self)(pc.count_substring_regex(self._pa_array, pat))
24782476

2479-
def _str_count(self, pat: str, flags: int = 0) -> Self:
2480-
if flags:
2481-
raise NotImplementedError(f"count not implemented with {flags=}")
2482-
return type(self)(pc.count_substring_regex(self._pa_array, pat))
2483-
24842477
def _str_repeat(self, repeats: int | Sequence[int]) -> Self:
24852478
if not isinstance(repeats, int):
24862479
raise NotImplementedError(

0 commit comments

Comments
 (0)