Skip to content

Commit 98c7b49

Browse files
committed
fallback to pointwise for ArrowEA
1 parent eb59549 commit 98c7b49

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pandas/core/arrays/_arrow_string_mixins.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
import numpy as np
1010

11-
from pandas.compat import pa_version_under10p1
11+
from pandas.compat import (
12+
pa_version_under10p1,
13+
pa_version_under13p0,
14+
)
1215

1316
from pandas.core.dtypes.missing import isna
1417

@@ -147,6 +150,15 @@ def _str_endswith(self, pat: str | tuple[str, ...], na: Scalar | None = None):
147150
return self._convert_bool_result(result)
148151

149152
def _str_find(self, sub: str, start: int = 0, end: int | None = None):
153+
if (
154+
pa_version_under13p0
155+
and not (start != 0 and end is not None)
156+
and not (start == 0 and end is None)
157+
):
158+
# GH#59562
159+
result = self._apply_elementwise(lambda val: val.find(sub, start, end))
160+
return self._convert_int_result(pa.chunked_array(result))
161+
150162
if (start == 0 or start is None) and end is None:
151163
result = pc.find_substring(self._pa_array, sub)
152164
else:

0 commit comments

Comments
 (0)