Skip to content

Commit 472f17a

Browse files
committed
fallback to pointwise for ArrowEA
1 parent 86ef129 commit 472f17a

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

@@ -214,6 +215,15 @@ def _str_contains(
214215
return self._convert_bool_result(result)
215216

216217
def _str_find(self, sub: str, start: int = 0, end: int | None = None):
218+
if (
219+
pa_version_under13p0
220+
and not (start != 0 and end is not None)
221+
and not (start == 0 and end is None)
222+
):
223+
# GH#59562
224+
result = self._apply_elementwise(lambda val: val.find(sub, start, end))
225+
return self._convert_int_result(pa.chunked_array(result))
226+
217227
if (start == 0 or start is None) and end is None:
218228
result = pc.find_substring(self._pa_array, sub)
219229
else:

0 commit comments

Comments
 (0)