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

Fix beam.Row.__eq__ to ignore key order #32850

Closed
wants to merge 2 commits into from

Conversation

Polber
Copy link
Contributor

@Polber Polber commented Oct 17, 2024

Beam Rows in the Python SDK are compared using an __eq__ method that considers the position of each key in the row. The case should be that order does not matter so long as all keys exists and have equal values of equal types.

Fixes #32832


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

Signed-off-by: Jeffrey Kinard <[email protected]>
@Polber Polber requested a review from robertwb October 17, 2024 22:47
@robertwb
Copy link
Contributor

I'm not positive we want comparison to be order-independent, see e.g. the comments on #23876

@Polber
Copy link
Contributor Author

Polber commented Oct 17, 2024

I'm not positive we want comparison to be order-independent, see e.g. the comments on #23876

Yeah it appears I totally missed a crucial comment

Note that in Beam 2.30.0 and later, Row objects are sensitive to field order.
So `Row(x=3, y=4)` is not considered equal to `Row(y=4, x=3)`.

It seems odd to me that order should matter on a schema'd data type, but I presume there is a use-case I'm not considering. In any case, I opened #32851 to fix the failing YAML tests

@Polber
Copy link
Contributor Author

Polber commented Oct 17, 2024

Closing in favor of #32851

@Polber Polber closed this Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Failing Test]: PreCommit Yaml Xlang Direct is broken
2 participants