-
Notifications
You must be signed in to change notification settings - Fork 901
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
Raise errors for unsupported operations on certain types #15712
Conversation
@@ -167,6 +167,46 @@ cdef class GroupBy: | |||
included_aggregations_i = [] | |||
col_aggregations = [] | |||
for agg in aggs: | |||
str_agg = str(agg) |
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.
Question: Is it not enough to raise the TypeError
if the if valid_aggregations == "ALL" or agg_obj.kind in valid_aggregations:
condition below fails?
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.
Ideally yes, but that is a very loose condition for many operations vs dtype matrix we have and libcudf seems to be silently returning empty columns for those. We need to dig deeper for other types aswell.
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.
OK. I suppose this PR is a good enough intermediate solution until we can centeralize this in get_valid_aggregation
or similar.
/merge |
After we made our groupby fail more aggressively for unsupported types in #15712, `Groupby.collect` started to fail on string column, where this isn't a supported aggregation on string column in pandas and this method doesn't exist in pandas Groupby, hence this PR suggest the alternative equivalent and deprecates the API to be removed in next release. Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) - Richard (Rick) Zamora (https://github.com/rjzamora) Approvers: - Matthew Roeschke (https://github.com/mroeschke) - Richard (Rick) Zamora (https://github.com/rjzamora) URL: #15808
Description
Fixes: #15668
This PR raises errors for groupby operations on un-supported types.
Checklist