Skip to content

CLN: pre-empt NotImplementedError in _aggregate_multiple_funcs #29582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,11 @@ def aggregate(self, func=None, *args, **kwargs):
return self._python_agg_general(func, *args, **kwargs)
elif args or kwargs:
result = self._aggregate_frame(func, *args, **kwargs)

elif self.axis == 1:
# _aggregate_multiple_funcs does not allow self.axis == 1
result = self._aggregate_frame(func)

else:

# try to treat as if we are passing a list
Expand All @@ -901,17 +906,11 @@ def aggregate(self, func=None, *args, **kwargs):
raise
result = self._aggregate_frame(func)
except NotImplementedError as err:
if "axis other than 0 is not supported" in str(err):
# raised directly by _aggregate_multiple_funcs
pass
elif "decimal does not support skipna=True" in str(err):
if "decimal does not support skipna=True" in str(err):
# FIXME: kludge for DecimalArray tests
pass
else:
raise
# FIXME: this is raised in a bunch of
# test_whitelist.test_regression_whitelist_methods tests,
# can be avoided
result = self._aggregate_frame(func)
else:
result.columns = Index(
Expand Down