You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* If the value is False, this option will be skipped
This is consistent with the Apache Beam pipeline options behaviour and makes it possible to define flag pipeline options. Setting a foo option as True in the provider operators pipeline_options and default_pipeline_options parameters would pass --foo to the Beam pipeline, while setting it to False should skip it, effectively acting as a flag argument.
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
Apache Airflow Provider(s)
apache-beam
Versions of Apache Airflow Providers
Reproduced in 5.3.0 but probably affects up to 5.6.2
Apache Airflow version
2.6.3
Operating System
macOS 14.1.1
Deployment
Virtualenv installation
Deployment details
No response
What happened
The Beam hook is parsing options passed to the pipeline incorrectly if the value is
False
.According to the docs, if the value is False, the option will be skipped
airflow/airflow/providers/apache/beam/operators/beam.py
Line 156 in b402f8a
This is consistent with the Apache Beam pipeline options behaviour and makes it possible to define flag pipeline options. Setting a
foo
option asTrue
in the provider operatorspipeline_options
anddefault_pipeline_options
parameters would pass--foo
to the Beam pipeline, while setting it toFalse
should skip it, effectively acting as a flag argument.However, the code in
airflow/airflow/providers/apache/beam/hooks/beam.py
Lines 66 to 88 in b402f8a
False
. Instead, it's applying the default behaviour of replacing the value with its textual representation.What you think should happen instead
The option should be skipped if the value is False.
How to reproduce
Running this DAG will log:
instead of the expected without the
flag_option_false
option.If
flag_option_false
is defined as a flag option in the Beam pipeline, the pipeline will fail:Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: