You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Beam JIRA Bot (Jira)" <ji...@apache.org> on 2022/03/17 17:26:00 UTC

[jira] [Commented] (BEAM-10418) Support type hint annotations on CombineFn add_input() and extract_output()

    [ https://issues.apache.org/jira/browse/BEAM-10418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17508323#comment-17508323 ] 

Beam JIRA Bot commented on BEAM-10418:
--------------------------------------

This issue is P2 but has been unassigned without any comment for 60 days so it has been labeled "stale-P2". If this issue is still affecting you, we care! Please comment and remove the label. Otherwise, in 14 days the issue will be moved to P3.

Please see https://beam.apache.org/contribute/jira-priorities/ for a detailed explanation of what these priorities mean.


> Support type hint annotations on CombineFn add_input() and extract_output()
> ---------------------------------------------------------------------------
>
>                 Key: BEAM-10418
>                 URL: https://issues.apache.org/jira/browse/BEAM-10418
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>            Reporter: Matt McDonald
>            Priority: P2
>              Labels: stale-P2, types
>
> Similar to the tweaks for supporting native type hints on the {{PTransform.expand()}} method (https://issues.apache.org/jira/browse/BEAM-10258), it would be beneficial if the {{CombineFn}} class also received similar treatment, offering a way to provide type hints through the native Python hinting interface.
> Adding hints to the CombineFn's {{add_input()}} and {{extract_output()}} methods should be sufficient for providing the equivalent behavior of annotating the class with beam typehint decorators, e.g.,
> {code:python}
> @beam.typehints.with_input_types(int)
> @beam.typehints.with_output_types(bool)
> class MyCombineFn(CombineFn):
>   ...
> {code}
> vs
> {code:python}
> class MyCombineFn(CombineFn):
>   def add_input(self, accumulator: float, element: int):
>     ...
>   def extract_output(self, accumulator: float) -> bool
>     ...
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)