Skip to content

Commit 6fd257a

Browse files
add back str_slice compat
1 parent 066af94 commit 6fd257a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/arrays/_arrow_string_mixins.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ def _str_get(self, i: int) -> Self:
131131
def _str_slice(
132132
self, start: int | None = None, stop: int | None = None, step: int | None = None
133133
) -> Self:
134+
if pa_version_under13p0:
135+
# GH#59724
136+
result = self._apply_elementwise(lambda val: val[start:stop:step])
137+
return type(self)(pa.chunked_array(result, type=self._pa_array.type))
134138
if start is None:
135139
if step is not None and step < 0:
136140
# GH#59710

0 commit comments

Comments
 (0)