We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 815579a commit 584ba18Copy full SHA for 584ba18
pandas/core/arrays/_arrow_string_mixins.py
@@ -55,7 +55,12 @@ def _str_pad(
55
elif side == "both":
56
if pa_version_under17p0:
57
# GH#59624 fall back to object dtype
58
- return super()._str_pad(width, side, fillchar)
+ from pandas import array
59
+
60
+ obj_arr = self.astype(object, copy=False) # type: ignore[attr-defined]
61
+ obj = array(obj_arr, dtype=object)
62
+ result = obj._str_pad(width, side, fillchar) # type: ignore[attr-defined]
63
+ return type(self)._from_sequence(result, dtype=self.dtype) # type: ignore[attr-defined]
64
else:
65
# GH#54792
66
pa_pad = partial(pc.utf8_center, lean_left_on_odd_padding=False)
0 commit comments