Skip to content

Commit 49a1cdc

Browse files
committed
fallback to pointwise for ArrowEA
1 parent 0e0ca96 commit 49a1cdc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/core/arrays/_arrow_string_mixins.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from pandas.compat import (
1313
pa_version_under10p1,
14+
pa_version_under13p0,
1415
pa_version_under17p0,
1516
)
1617

@@ -163,6 +164,15 @@ def _str_endswith(self, pat: str | tuple[str, ...], na: Scalar | None = None):
163164
return self._convert_bool_result(result)
164165

165166
def _str_find(self, sub: str, start: int = 0, end: int | None = None):
167+
if (
168+
pa_version_under13p0
169+
and not (start != 0 and end is not None)
170+
and not (start == 0 and end is None)
171+
):
172+
# GH#59562
173+
result = self._apply_elementwise(lambda val: val.find(sub, start, end))
174+
return self._convert_int_result(pa.chunked_array(result))
175+
166176
if (start == 0 or start is None) and end is None:
167177
result = pc.find_substring(self._pa_array, sub)
168178
else:

0 commit comments

Comments
 (0)