-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Data] Enable group over multiple keys in datasets #37832
[Data] Enable group over multiple keys in datasets #37832
Conversation
Signed-off-by: Abdel Jaidi <jaidisido@gmail.com>
Signed-off-by: Abdel Jaidi <jaidisido@gmail.com>
Signed-off-by: Abdel Jaidi <jaidisido@gmail.com>
Signed-off-by: Anton Kukushkin <kukushkin.anton@gmail.com>
Signed-off-by: Anton Kukushkin <kukushkin.anton@gmail.com>
Signed-off-by: Anton Kukushkin <kukushkin.anton@gmail.com>
Signed-off-by: Anton Kukushkin <kukushkin.anton@gmail.com>
Signed-off-by: Anton Kukushkin <kukushkin.anton@gmail.com>
Signed-off-by: Anton Kukushkin <kukushkin.anton@gmail.com>
Signed-off-by: Anton Kukushkin <kukushkin.anton@gmail.com>
Signed-off-by: Anton Kukushkin <kukushkin.anton@gmail.com>
Signed-off-by: Anton Kukushkin <kukushkin.anton@gmail.com>
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.
Minor comments
if ds_format == "pandas": | ||
ds = _to_pandas(ds) | ||
|
||
agg_ds = ds.groupby(["A", "B"]).count() |
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.
Is the .count()
superfluous given that it's done again on the line below it?
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.
The line below just checks the row count of the result of this operation. This amounts to just checking that there were indeed 6 groups in the original frame.
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.
LGTM overall. Sorry for the delay in reviews, as the 2.8 release was approaching.
python/ray/data/_internal/planner/exchange/aggregate_task_spec.py
Outdated
Show resolved
Hide resolved
@LeonLuttenberger - thanks for the contribution! Shall we also add a unit test to test out Technically after this PR, |
Sounds good, I'm creating a PR to add the test for |
Why are these changes needed?
This is a first draft into enabling grouping Ray datasets over multiple keys (i.e. passing a list of keys to
.group()
).A new unit test
test_groupby_multiple_keys_tabular_count
showcases an example.Depends on #37124 being merged first.
Related issue number
#25732
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.