Fix custom coders not being used in Reshuffle (non global window)#33363
Merged
robertwb merged 19 commits intoapache:masterfrom Dec 14, 2024
Merged
Fix custom coders not being used in Reshuffle (non global window)#33363robertwb merged 19 commits intoapache:masterfrom
robertwb merged 19 commits intoapache:masterfrom
Conversation
… non-global windows.
…rect type constraint in Beam.
…kroundand keep it un-cythonized.
Collaborator
Author
Collaborator
Author
|
Run Flink Container PreCommit |
Contributor
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
robertwb
approved these changes
Dec 14, 2024
| @classmethod | ||
| def from_type_hint(cls, typehint, registry): | ||
| # type: (Any, CoderRegistry) -> WindowedValueCoder | ||
| return cls(registry.get_coder(typehint.inner_type)) |
Contributor
There was a problem hiding this comment.
Can you add a TODO to pass the right coder for the Window as well (so we don't fall back to PickleCoder to encode the windows?) This would require making TypedWindowedValue have two type parameters, the second being optional, and might get messy, so can be deferred for now so we can get this in to unbreak things.
Contributor
There was a problem hiding this comment.
Actually, I'll just drop the note now.
Collaborator
Author
There was a problem hiding this comment.
Thank you Robert!
shunping
added a commit
to shunping/beam
that referenced
this pull request
Dec 18, 2024
- Fix custom coder not being used in Reshuffle (global window) (apache#33339) - Fix custom coders not being used in Reshuffle (non global window) apache#33363 - Add missing to_type_hint to WindowedValueCoder apache#33403
stankiewicz
pushed a commit
to stankiewicz/beam
that referenced
this pull request
Jan 16, 2025
…ache#33363) * Fix typehint in ReshufflePerKey on global window setting. * Only update the type hint on global window setting. Need more work in non-global windows. * Apply yapf * Fix some failed tests. * Revert change to setup.py * Fix custom coders not being used in reshuffle in non-global windows * Revert changes in setup.py. Reformat. * Make WindowedValue a generic class. Support its conversion to the correct type constraint in Beam. * Cython does not support Python generic class. Add a subclass as a workroundand keep it un-cythonized. * Add comments * Fix type error. * Remove the base class of WindowedValue in TypedWindowedValue. * Move TypedWindowedValue out from windowed_value.py * Revise the comments * Fix the module location when matching. * Fix test failure where __name__ of a type alias not found in python 3.9 * Add a note about the window coder. --------- Co-authored-by: Robert Bradshaw <robertwb@gmail.com>
stankiewicz
pushed a commit
to stankiewicz/beam
that referenced
this pull request
Jan 16, 2025
- Fix custom coder not being used in Reshuffle (global window) (apache#33339) - Fix custom coders not being used in Reshuffle (non global window) apache#33363 - Add missing to_type_hint to WindowedValueCoder apache#33403
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The follow-up PR of #33339 to fix the non-global window scenario.
fixes #33356