beam icon indicating copy to clipboard operation
beam copied to clipboard

[Bug]: Beam Yaml Jinja option may conflict with well known Pipeline option

Open Abacn opened this issue 10 months ago • 5 comments

What happened?

Saying I have a Yaml pipeline has a Jinja vairable 'projectId', it may conflicts with the well known pipeline option project due to here

https://github.com/apache/beam/blob/112685de58d7b24b70b8d8eb7171f0e28b35a2f1/sdks/python/apache_beam/yaml/main.py#L63

jinja_variable_parser may "unambiguously" parsed "--project" as "--projectId", causing --project pipeline option treated as a jinja variable and removed from pipeline options passing to pipeline construction

This can cause weird error ValueError: Pipeline has validations errors: Missing required option: project. when submitting pipeline to Dataflow

We should set allow_abbrev to False. But this still doesn't fully avoid confliction when a jinja variable also named project

Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

Issue Components

  • [ ] Component: Python SDK
  • [ ] Component: Java SDK
  • [ ] Component: Go SDK
  • [ ] Component: Typescript SDK
  • [ ] Component: IO connector
  • [ ] Component: Beam YAML
  • [ ] Component: Beam examples
  • [ ] Component: Beam playground
  • [ ] Component: Beam katas
  • [ ] Component: Website
  • [ ] Component: Infrastructure
  • [ ] Component: Spark Runner
  • [ ] Component: Flink Runner
  • [ ] Component: Samza Runner
  • [ ] Component: Twister2 Runner
  • [ ] Component: Hazelcast Jet Runner
  • [ ] Component: Google Cloud Dataflow Runner

Abacn avatar Feb 02 '26 16:02 Abacn

Fixed the case of a_jinja_variablel.startswith(a_pipeline_option). Re-open to track the scenario that jinja_variable sharing the same name with pipeline option

Abacn avatar Feb 02 '26 19:02 Abacn

Hi, can I work on this issue? Please let me contribute

krishiekrashie avatar Feb 03 '26 15:02 krishiekrashie

Hi @krishiekrashie, thanks for your interests. The remaining part is a subtle issue and this bug is left for tracking purpose, to warn that users should not create jinja variable that has same name with well known pipeline options. Let me adjust the priority.

Abacn avatar Feb 03 '26 16:02 Abacn

This issue has been marked as stale due to 150 days of inactivity. It will be closed in 30 days if no further activity occurs. If you think that’s incorrect or this issue still needs to be addressed, please simply write any comment. If closed, you can reopen the issue at any time. Thank you for your contributions.

github-actions[bot] avatar Jul 04 '26 12:07 github-actions[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, you can reopen the issue at any time.

github-actions[bot] avatar Aug 03 '26 13:08 github-actions[bot]