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

[Dataset] Validate sort key in Sort LogicalOperator #34282

Merged
merged 13 commits into from
Apr 14, 2023

Conversation

scottjlee
Copy link
Contributor

@scottjlee scottjlee commented Apr 11, 2023

Why are these changes needed?

See #32137

Related issue number

Closes #32137

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: Scott Lee <sjl@anyscale.com>
Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: Scott Lee <sjl@anyscale.com>
@scottjlee scottjlee marked this pull request as ready for review April 12, 2023 01:00
Comment on lines 41 to 52
if block_metadata.schema is not None and valid_block_schema is None:
valid_block_schema = block_metadata.schema
block_schemas.append(block_metadata.schema)
if len(blocks) == 0:
return (blocks, {})
if isinstance(valid_block_schema, pa.lib.Schema):
unified_schema = unify_schemas(block_schemas)
else: # Covers both simple-type and None cases.
if isinstance(valid_block_schema, type):
assert all([b == valid_block_schema for b in block_schemas])
unified_schema = valid_block_schema
_validate_key_fn(unified_schema, key)
Copy link
Contributor

Choose a reason for hiding this comment

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

could we refactor https://github.com/ray-project/ray/blob/master/python/ray/data/_internal/plan.py#L427-L453 into a common method, and reuse the same code here?

Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: Scott Lee <sjl@anyscale.com>
Signed-off-by: Scott Lee <sjl@anyscale.com>
@scottjlee scottjlee requested a review from c21 April 14, 2023 01:23
@scottjlee scottjlee added the tests-ok The tagger certifies test failures are unrelated and assumes personal liability. label Apr 14, 2023
Copy link
Contributor

@c21 c21 left a comment

Choose a reason for hiding this comment

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

LG

@c21
Copy link
Contributor

c21 commented Apr 14, 2023

Merging to master.

@c21 c21 merged commit d866245 into ray-project:master Apr 14, 2023
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
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.

[Datasets] Validate sort key in logical operator
2 participants