-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ERR: Better error message for missing columns in aggregate #32836
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
Conversation
… to user non-existing columns causing error Line too long - corrected What's New Updated Tests Fixed testing errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine, ping on green.
@@ -356,7 +356,11 @@ def _aggregate(self, arg, *args, **kwargs): | |||
if isinstance(obj, ABCDataFrame) and len( | |||
obj.columns.intersection(keys) | |||
) != len(keys): | |||
raise SpecificationError("nested renamer is not supported") | |||
cols = sorted(set(keys) - set(obj.columns.intersection(keys))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not worth it dispatching on both, just make. single message
doc/source/whatsnew/v1.1.0.rst
Outdated
@@ -84,7 +84,7 @@ Other API changes | |||
- Added :meth:`DataFrame.value_counts` (:issue:`5377`) | |||
- :meth:`Groupby.groups` now returns an abbreviated representation when called on large dataframes (:issue:`1135`) | |||
- ``loc`` lookups with an object-dtype :class:`Index` and an integer key will now raise ``KeyError`` instead of ``TypeError`` when key is missing (:issue:`31905`) | |||
- | |||
- :meth:`DataFrame.agg` now provides more descriptive SpecificationError message when attempting to aggregating non-existant column (:issue:`32755`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move this to reshaping
merge master to fix the docs issue |
@jreback Made changes and green |
thanks @JDTruj2018 |
More descriptive SpecificationError message that reports to user non-existing columns causing error
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff