[ 
https://issues.apache.org/jira/browse/BEAM-7867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Beam JIRA Bot updated BEAM-7867:
--------------------------------
    Labels: stale-P2  (was: )

> DoFn invocation has wrong argument assignment
> ---------------------------------------------
>
>                 Key: BEAM-7867
>                 URL: https://issues.apache.org/jira/browse/BEAM-7867
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Udi Meiri
>            Priority: P2
>              Labels: stale-P2
>
> I've added this test to DoFnProcessTest:
> {code}
>     class DoFnProcessAllDefaults(DoFn):
>       def process(self, element=1, timestamp=DoFn.TimestampParam, 
> side_input=3):
>         print('element={} timestamp={} side_input={}'.format(
>             element, timestamp, side_input))
>     pipeline_options = PipelineOptions()
>     with TestPipeline(options=pipeline_options) as p:
>       _ = (p
>            | beam.Create([5])
>            | beam.ParDo(DoFnProcessAllDefaults(), 2))
> {code}
> The print output is:
> {code}
> element=5 timestamp=2 side_input=Timestamp(-9223372036854.775000)
> {code}
> If the default value for `element` is removed:
> {code}
> element=5 timestamp=Timestamp(-9223372036854.775000) side_input=2
> {code}
> Bug is in PerWindowInvoker.__init__, found while working on type hints 
> related code.
> The issue is with args_to_pick, which goes to -1 in the first case.
> Note that prototypes like process(element=1) and process(element=1, 
> timestamp=DoFn.TimestampParam) work fine, so there could be existing 
> pipelines that have such process() methods.
> [~robertwb][~altay]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to