diff --git a/pandas/core/strings/object_array.py b/pandas/core/strings/object_array.py index dc4550484fa3b..b794690ccc5af 100644 --- a/pandas/core/strings/object_array.py +++ b/pandas/core/strings/object_array.py @@ -198,6 +198,7 @@ def scalar_rep(x): return self._str_map(scalar_rep, dtype=str) else: from pandas.core.arrays.string_ import StringArray + from pandas.core.arrays.string_arrow import ArrowStringArray def rep(x, r): if x is libmissing.NA: @@ -209,9 +210,9 @@ def rep(x, r): repeats = np.asarray(repeats, dtype=object) result = libops.vec_binop(np.asarray(self), repeats, rep) - if isinstance(self, StringArray): + if isinstance(self, (StringArray, ArrowStringArray)): # Not going through map, so we have to do this here. - result = StringArray._from_sequence(result) + result = type(self)._from_sequence(result) return result def _str_match( diff --git a/pandas/tests/strings/test_strings.py b/pandas/tests/strings/test_strings.py index a809446f0bc06..06b22f00a38cf 100644 --- a/pandas/tests/strings/test_strings.py +++ b/pandas/tests/strings/test_strings.py @@ -136,14 +136,8 @@ def test_repeat(): tm.assert_series_equal(rs, xp) -def test_repeat_with_null(nullable_string_dtype, request): +def test_repeat_with_null(nullable_string_dtype): # GH: 31632 - - if nullable_string_dtype == "arrow_string": - reason = 'Attribute "dtype" are different' - mark = pytest.mark.xfail(reason=reason) - request.node.add_marker(mark) - ser = Series(["a", None], dtype=nullable_string_dtype) result = ser.str.repeat([3, 4]) expected = Series(["aaa", None], dtype=nullable_string_dtype)