-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Resample.aggregate raising TypeError instead of SpecificationError with missing keys dtypes #39028
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
phofl
commented
Jan 7, 2021
- closes BUG: Missing keys using aggregation dictionary that are unsortable raise TypeError instead of SpecificationError #39025
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
pandas/core/aggregation.py
Outdated
@@ -738,7 +738,10 @@ def agg_dict_like( | |||
if isinstance(selected_obj, ABCDataFrame) and len( | |||
selected_obj.columns.intersection(keys) | |||
) != len(keys): | |||
cols = sorted(set(keys) - set(selected_obj.columns.intersection(keys))) | |||
cols = sorted( |
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 just use safe_sort?
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.
Yes, of course. Thx. Forgot about safe sort...
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.
Hm had to add list calls
Thanks @phofl for the PR. There is a very similar issue There are many tests that go through that path that could be used as the basis for a test for a fix.
AssertionError due to so could either fix here, or shall I create a dedicated bug report? update: ignore |
I could look into this in the evening, when this pr is not merged until then we could do this here |
@simonjayhawkins Fixed it. I am not quite sure why the test was where it was, so I moved it into the frame folder. |
i know we marked the issues as a regression but that was from 1.0.x, so 1.3 is fine. |
Thought the same, since only the message is the problem |
thanks @phofl |
…or with missing keys dtypes (pandas-dev#39028)