-
Notifications
You must be signed in to change notification settings - Fork 651
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
Simple groupby causes TypeError #1770
Comments
Is this an issue for OmniSci only? Please choose an appropriate label so we can classify this issue. Thanks! |
This is a back-end agnostic issue. The problem is in front-end. |
I see, thanks for clarifying. I have added to next release since there is not time to fix for this release. |
@ienkovich Good catch, that example is significantly more complicated because the grouping values come from a transformation on the data rather than the data itself. We should track that particular case separately because it will require special care. |
OK, I will open a separate issue for the additional case. |
… by list. Signed-off-by: Itamar Turner-Trauring <itamar@itamarst.org>
Signed-off-by: Itamar Turner-Trauring <itamar@itamarst.org>
… by list. Signed-off-by: Itamar Turner-Trauring <itamar@itamarst.org>
Here is a failing test:
The reason of fail is in DataFrame.groupby code. When we see that 'by' is a list, but it doesn't hold column labels only, we compare its length to index length. If lengths match, we assume, that 'by' holds key data, not a list of key columns/Series. In the test above this assumption is wrong.
Also, this length check triggers execution for lazy frame, which we want to avoid. So, we need to first check if 'by' is a list of key columns/Series and check index length only when we have to assume, that 'by' holds key data.
The text was updated successfully, but these errors were encountered: