-
Notifications
You must be signed in to change notification settings - Fork 6.9k
[Data] Support Non-Hashable Types for Unique Aggregator and encode_lists flag
#58916
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Daniel Shin <[email protected]>
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.
Code Review
This pull request adds support for non-hashable types to the Unique aggregator by using pickling, and introduces an encode_lists flag for more flexible handling of list data. The implementation is sound and includes a comprehensive set of tests. My review includes one suggestion to refactor the aggregate_block method for improved performance and readability.
Signed-off-by: Daniel Shin <[email protected]>
…ion; previous ignore_nulls was broken Signed-off-by: Daniel Shin <[email protected]>
Signed-off-by: Daniel Shin <[email protected]>
Signed-off-by: Daniel Shin <[email protected]>
| Std("B", alias_name="std_b", ignore_nulls=ignore_nulls), | ||
| Quantile("B", alias_name="quantile_b", ignore_nulls=ignore_nulls), | ||
| Unique("B", alias_name="unique_b"), | ||
| Unique("B", alias_name="unique_b", ignore_nulls=False), |
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.
this is to fix tests, because ignore_nulls was broken before, so we don't filter for nulls at all
Signed-off-by: Daniel Shin <[email protected]>
Description
Basically the same idea as #58659
So
Uniqueaggregator usespyarrow.compute.uniquefunction internally. This doesn't work with non-hashable types like lists. Similar to what I did forApproximateTopK, we now use pickle to serialize and deserialize elements.Other improvements:
ignore_nullsflag didn't work at all. This flag now properly worksignore_nulls=Falsefor datasetsuniqueapi for backwards compatibility (we setignore_nullstoTrueby default, so behavior for datasetsuniqueapi will change now thatignore_nullsactually works)Related issues
This PR replaces #58538
Additional information
N/A