Details
-
New Feature
-
Status: Open
-
P3
-
Resolution: Unresolved
-
None
-
None
Description
Feature request:
Allow users to specify a typehint for the accumulator type of CombineFn, either through a typehints decorator, or by using Python type annotations on the CombineFn methods, or through inheriting a CombineFn generic type.
Benefits:
- Allow the user to specify a more efficient coder for accumulators if one is available. Currently users are able to do this for the input and output elements, but not the accumulators, which always uses the fallback coder.
- Allows typechecking of methods for CombineFn e.g. check that create_accumulator(), add_input() and merge_accumulators() returns accumulators. This provides better developer ergonomics as the CombineFnAPI is non-trivial.