[
https://issues.apache.org/jira/browse/BEAM-7867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17137200#comment-17137200
]
Beam JIRA Bot commented on BEAM-7867:
-------------------------------------
This issue was marked "stale-P2" and has not received a public comment in 14
days. It is now automatically moved to P3. If you are still affected by it, you
can comment and move it back to P2.
> 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: P3
>
> 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)