We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 767857e commit ee6561bCopy full SHA for ee6561b
pandas/core/arrays/_arrow_string_mixins.py
@@ -40,7 +40,12 @@ def _str_pad(
40
elif side == "both":
41
if pa_version_under17p0:
42
# GH#59624 fall back to object dtype
43
- return super()._str_pad(width, side, fillchar)
+ from pandas import array
44
+
45
+ obj_arr = self.astype(object, copy=False) # type: ignore[attr-defined]
46
+ obj = array(obj_arr, dtype=object)
47
+ result = obj._str_pad(width, side, fillchar) # type: ignore[attr-defined]
48
+ return type(self)._from_sequence(result, dtype=self.dtype) # type: ignore[attr-defined]
49
else:
50
# GH#54792
51
pa_pad = partial(pc.utf8_center, lean_left_on_odd_padding=False)
0 commit comments