Skip to content
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

Fix type mismatch in groupby reduction for empty objects #13942

Merged
merged 7 commits into from
Aug 24, 2023

Conversation

galipremsagar
Copy link
Contributor

Description

closes #13941

This PR preserves the column types, for group by reduction operations that are performed on empty objects.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@galipremsagar galipremsagar added bug Something isn't working 3 - Ready for Review Ready for review by team Python Affects Python cuDF API. non-breaking Non-breaking change labels Aug 23, 2023
@galipremsagar galipremsagar requested a review from a team as a code owner August 23, 2023 19:03
@galipremsagar galipremsagar self-assigned this Aug 23, 2023
@@ -563,7 +569,10 @@ def agg(self, func):
):
# Structs lose their labels which we reconstruct here
col = col._with_type_metadata(cudf.ListDtype(orig_dtype))
data[key] = col
if is_empty and is_reduction and len(col) == 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the values of is_empty and is_reduction are only used here, maybe we can declare/evaluate them closer to here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yupp, moved it closer.

@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Aug 23, 2023
@galipremsagar
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 6ed42d7 into rapidsai:branch-23.10 Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Reduction operation on groupby need to return same type as column for empty object
2 participants