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
PickleCoder.as_deterministic_coder() and _MemoizingPickleCoder.as_deterministic_coder() raise TypeError on every call instead of returning a working deterministic coder.
FastPrimitivesCoder.__init__(self, fallback_coder=PickleCoder()) has never accepted a requires_deterministic argument, so this raises:
TypeError: FastPrimitivesCoder.__init__() got an unexpected keyword argument 'requires_deterministic'
Repro on current master:
fromapache_beam.coders.codersimportPickleCoderPickleCoder().as_deterministic_coder('label')
# TypeError: FastPrimitivesCoder.__init__() got an unexpected keyword argument 'requires_deterministic'
Root cause: commit 9be70c9 (2021-03-08) changed PickleCoder.as_deterministic_coder from the working DeterministicFastPrimitivesCoder(self, step_label) to the broken FastPrimitivesCoder(self, requires_deterministic=...) in the same diff that added a requires_deterministic kwarg to a different class, coder_impl.FastPrimitivesCoderImpl (the Cython impl, not the coders.FastPrimitivesCoder wrapper referenced here). _MemoizingPickleCoder (added later) copied the same already-broken line.
Any caller that resolves to one of these coders and asks for a deterministic version hits this, for example GroupByEncryptedKey.expand() in apache_beam/transforms/util.py, which wraps the call in except ValueError and does not catch the TypeError, so it crashes instead of logging the intended non-deterministic-key warning.
This is a narrower, separate defect from #28558's own headline claim (which is about pickle_library being ignored, and was addressed by @tvalentyn as working as intended for PickleCoder). @tvalentyn identified this specific as_deterministic_coder bug in a comment on that thread in 2023 and invited a PR for it, but #28558 itself is now closed and its title does not match this fix, so filing it here as its own issue.
Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
Activity
AmirF194 commentedon Aug 31, 2026
.take-issue
Fix PickleCoder.as_deterministic_coder() raising TypeError (#39943)