You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Direct Runner doesn't use coder registered in registry? #29908
I'm trying to write a coder for an unpicklable object, but when I register it with the coder registry, the direct runner seems to want to try to pickle it anyways. I've created an example in beam playground
Not sure if I'm just missing something trivial here
#18490 was a red herring. The issue isn't exactly with the python direct runner either. I think the issue is that apache_beam.transforms.util.ReshufflePerKey uses type hints Any and Any data use the picklecoder rather than any specially specified coder in the coder registry.
Yes, that indeed works. I think the issue is more that when this happens, it's difficult to identify why, especially if you think that the registry coder will get respected all the time.
I have a limited fix that I haven't gotten around to posting yet that narrows the type definitions in ReshufflePerKey for global windows. This fixes some part of the issue
Activity
hjtran commentedon Jan 3, 2024
Might this be related to #18490
hjtran commentedon Jan 4, 2024
#18490 was a red herring. The issue isn't exactly with the python direct runner either. I think the issue is that
apache_beam.transforms.util.ReshufflePerKeyuses type hintsAnyandAnydata use the picklecoder rather than any specially specified coder in the coder registry.tvalentyn commentedon Jan 29, 2024
have you tried setting
with_output_types/with_input_typesexplicitly after create or on reshuffle ?hjtran commentedon Jan 29, 2024
Yes, that indeed works. I think the issue is more that when this happens, it's difficult to identify why, especially if you think that the registry coder will get respected all the time.
I have a limited fix that I haven't gotten around to posting yet that narrows the type definitions in
ReshufflePerKeyfor global windows. This fixes some part of the issue