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

[Data] Add Dataset.rename_columns #47906

Merged
merged 5 commits into from
Oct 9, 2024
Merged

[Data] Add Dataset.rename_columns #47906

merged 5 commits into from
Oct 9, 2024

Conversation

bveeramani
Copy link
Member

Why are these changes needed?

Related issue number

Fixes #32261

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 added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • 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 :(

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: Balaji Veeramani <[email protected]>
Copy link
Contributor

@omatthew98 omatthew98 left a comment

Choose a reason for hiding this comment

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

Minor comments to align directly with the pyarrow rename_columns API since we are just thinly wrapping it.

python/ray/data/dataset.py Show resolved Hide resolved
raise ValueError(
"Expected `concurrency` to be an integer or `None`, but got "
f"{concurrency}."
)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, concurrency validation will be done within map_batches. no need to add it here

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm performing an additional validation here to avoid this confusing error message when you pass a tuple to concurrency:

ValueError: concurrency is set as a tuple of integers, but fn is not a callable class: <function Dataset.rename_columns..rename_columns at 0x166532550>. Use concurrency=n to control maximum number of workers to use.

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: Balaji Veeramani <[email protected]>
@bveeramani bveeramani enabled auto-merge (squash) October 9, 2024 16:09
@github-actions github-actions bot disabled auto-merge October 9, 2024 16:10
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Oct 9, 2024
@bveeramani bveeramani merged commit c9bb68b into master Oct 9, 2024
7 checks passed
@bveeramani bveeramani deleted the rename-columns branch October 9, 2024 18:03
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Fixes ray-project#32261

---------

Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: ujjawal-khare <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Datasets] Add Datasets.rename_columns
3 participants