Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-8519

Typehint for Python CombineFn Accumulator

Details

    • New Feature
    • Status: Open
    • P3
    • Resolution: Unresolved
    • None
    • None
    • sdk-py-core

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            myffical@gmail.com Yifan Mai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: