Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
rhshadrach committed Feb 15, 2025
1 parent 188f92e commit c04969e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
10 changes: 0 additions & 10 deletions pandas/core/arrays/string_.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions pandas/tests/groupby/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit c04969e

Please sign in to comment.