diff --git a/pandas/core/arrays/string_.py b/pandas/core/arrays/string_.py index 10b2a62828ddb..69e3be87b2b9b 100644 --- a/pandas/core/arrays/string_.py +++ b/pandas/core/arrays/string_.py @@ -899,16 +899,6 @@ def _accumulate(self, name: str, *, skipna: bool = True, **kwargs) -> StringArra ------ NotImplementedError : subclass does not define accumulations """ - if is_string_dtype(self): - return self._str_accumulate(name=name, skipna=skipna, **kwargs) - return super()._accumulate(name=name, skipna=skipna, **kwargs) - - def _str_accumulate( - self, name: str, *, skipna: bool = True, **kwargs - ) -> StringArray: - """ - Accumulate implementation for strings, see `_accumulate` docstring for details. - """ if name == "cumprod": msg = f"operation '{name}' not supported for dtype '{self.dtype}'" raise TypeError(msg) diff --git a/pandas/tests/groupby/test_categorical.py b/pandas/tests/groupby/test_categorical.py index e050d475b744f..e49be8c00b426 100644 --- a/pandas/tests/groupby/test_categorical.py +++ b/pandas/tests/groupby/test_categorical.py @@ -358,6 +358,7 @@ def test_observed(request, using_infer_string, observed): expected = cartesian_product_for_groupers( expected, [cat1, cat2], list("AB"), fill_value=0 ) + tm.assert_frame_equal(result, expected)