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] Add logical operator for sort() #32133

Merged
merged 1 commit into from
Feb 1, 2023
Merged

Conversation

c21
Copy link
Contributor

@c21 c21 commented Jan 31, 2023

Signed-off-by: Cheng Su scnju13@gmail.com

Why are these changes needed?

This PR is to add logical operator for sort(), the change includes:

  • Sort logical operator
  • SortTaskSpec to copy from sort.py
  • generate_sort_fn is generated function for sort

Related issue number

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 :(



class SortTaskSpec(ExchangeTaskSpec):
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is copied from https://github.com/ray-project/ray/blob/master/python/ray/data/_internal/sort.py, with change from BlockList to RefBundle.

Signed-off-by: Cheng Su <scnju13@gmail.com>
descending: bool,
) -> AllToAllTransformFn:
"""Generate function to sort blocks by the specified key column or key function."""
# TODO: validate key with block._validate_key_fn.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created #32137 for followup. This needs more refactoring, as it involves Dataset object.

@ericl ericl merged commit 75419d3 into ray-project:master Feb 1, 2023
@c21 c21 deleted the sort branch February 1, 2023 07:22
edoakes pushed a commit to edoakes/ray that referenced this pull request Mar 22, 2023
This PR is to add logical operator for `sort()`, the change includes:
* `Sort` logical operator
* `SortTaskSpec` to copy from `sort.py`
* `generate_sort_fn` is generated function for sort

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
c21 pushed a commit that referenced this pull request Apr 14, 2023
As a followup of #32133, we should validate key with block.py:_validate_key_fn(), in generate_sort_fn() before doing sort.

Signed-off-by: Scott Lee <sjl@anyscale.com>
vitsai pushed a commit to vitsai/ray that referenced this pull request Apr 17, 2023
)

As a followup of ray-project#32133, we should validate key with block.py:_validate_key_fn(), in generate_sort_fn() before doing sort.

Signed-off-by: Scott Lee <sjl@anyscale.com>
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
)

As a followup of ray-project#32133, we should validate key with block.py:_validate_key_fn(), in generate_sort_fn() before doing sort.

Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: elliottower <elliot@elliottower.com>
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
)

As a followup of ray-project#32133, we should validate key with block.py:_validate_key_fn(), in generate_sort_fn() before doing sort.

Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: Jack He <jackhe2345@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants