Skip to content

Commit 517fdd0

Browse files
committed
fallback to pointwise for ArrowEA
1 parent 0cb74e2 commit 517fdd0

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

@@ -199,6 +200,15 @@ def _str_isupper(self):
199200
return self._convert_bool_result(result)
200201

201202
def _str_find(self, sub: str, start: int = 0, end: int | None = None):
203+
if (
204+
pa_version_under13p0
205+
and not (start != 0 and end is not None)
206+
and not (start == 0 and end is None)
207+
):
208+
# GH#59562
209+
result = self._apply_elementwise(lambda val: val.find(sub, start, end))
210+
return self._convert_int_result(pa.chunked_array(result))
211+
202212
if (start == 0 or start is None) and end is None:
203213
result = pc.find_substring(self._pa_array, sub)
204214
else:

0 commit comments

Comments
 (0)