-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 custom coders not being used in Reshuffle (non global window) #33363
Fix custom coders not being used in Reshuffle (non global window) #33363
Conversation
… non-global windows.
…rect type constraint in Beam.
…kroundand keep it un-cythonized.
Run Flink Container PreCommit |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@classmethod | ||
def from_type_hint(cls, typehint, registry): | ||
# type: (Any, CoderRegistry) -> WindowedValueCoder | ||
return cls(registry.get_coder(typehint.inner_type)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'll just drop the note now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Robert!
- 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
…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 <[email protected]>
- 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
The follow-up PR of #33339 to fix the non-global window scenario.
fixes #33356