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

[Datasets] Convert between block and batch correctly for map_groups #30172

Merged
merged 2 commits into from
Nov 14, 2022

Conversation

c21
Copy link
Contributor

@c21 c21 commented Nov 10, 2022

Signed-off-by: Cheng Su [email protected]

Why are these changes needed?

This is to fix issue found in #30102, where user can do ds.groupby("key").map_groups(fn, batch_format="numpy"). We need to correctly convert between block and batch in map_groups to handle it.

Related issue number

Closes #30102

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Copy link
Contributor

@clarkzinzow clarkzinzow left a comment

Choose a reason for hiding this comment

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

LGTM!

builder.add_block(applied)
group_block = block_accessor.slice(start, end)
group_block_accessor = BlockAccessor.for_block(group_block)
group_batch = group_block_accessor.to_batch_format(batch_format)
Copy link
Contributor

Choose a reason for hiding this comment

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

Briefly comment there is batch -> block -> batch trip needed 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.

@jianoaix - sounds good, added.

Signed-off-by: Cheng Su <[email protected]>
@c21 c21 added the tests-ok The tagger certifies test failures are unrelated and assumes personal liability. label Nov 14, 2022
@clarkzinzow clarkzinzow merged commit 82ccb15 into ray-project:master Nov 14, 2022
@jiaodong
Copy link
Member

thanks for the quick fix ! This can make one of our cv user's AIR onboarding UX much cleaner.

@c21 c21 deleted the map-group branch November 14, 2022 19:03
WeichenXu123 pushed a commit to WeichenXu123/ray that referenced this pull request Dec 19, 2022
…ay-project#30172)

This is to fix issue found in ray-project#30102, where user can do ds.groupby("key").map_groups(fn, batch_format="numpy"). We need to correctly convert between block and batch in map_groups to handle it.

Signed-off-by: Weichen Xu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests-ok The tagger certifies test failures are unrelated and assumes personal liability.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Data] map_groups doesn't work with "numpy" batch format
4 participants