[
https://issues.apache.org/jira/browse/BEAM-12446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yichi Zhang updated BEAM-12446:
-------------------------------
Description:
if kw args of process function are declared before DnFnParam placeholders the
fulfillment will shift to wrong index unexpectedly.
For example if process has signature
{{def process(element, an_arg='x', w=DoFn.WindowParam):
...}}
at runtime the window param will be mapped onto 'an_arg' instead of w, and w
will not be replaced with runtime value, causing confusing behaviors. (e.g.
an_arg will be an instance of GlobalWindow or FixedWindow but w is still
DoFn.WindowParam).
was:
When user specified side input in a DoFn but forgot to provide the args in the
pipeline, the error is thrown at runtime and it doesn't clearly point out the
problem.
For example:
https://stackoverflow.com/questions/67625087/attributeerror-dofnparam-object-has-no-attribute-start-while-running-wri
it throws
AttributeError: '_DoFnParam' object has no attribute 'start' During handling of
the above exception, another exception occurred:
We should to static checking on the parameters and make sure that clear
validation error is thrown when an expected side input is missing
> Wrong process function arg order cause unexpected runtime value shift
> ---------------------------------------------------------------------
>
> Key: BEAM-12446
> URL: https://issues.apache.org/jira/browse/BEAM-12446
> Project: Beam
> Issue Type: Improvement
> Components: sdk-py-core
> Reporter: Yichi Zhang
> Assignee: Yichi Zhang
> Priority: P2
> Time Spent: 10m
> Remaining Estimate: 0h
>
> if kw args of process function are declared before DnFnParam placeholders the
> fulfillment will shift to wrong index unexpectedly.
> For example if process has signature
> {{def process(element, an_arg='x', w=DoFn.WindowParam):
> ...}}
> at runtime the window param will be mapped onto 'an_arg' instead of w, and w
> will not be replaced with runtime value, causing confusing behaviors. (e.g.
> an_arg will be an instance of GlobalWindow or FixedWindow but w is still
> DoFn.WindowParam).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)