jscheffl commented on issue #36369:
URL: https://github.com/apache/airflow/issues/36369#issuecomment-1913326274
> @jscheffl sorry for the delay. That is a great question, at a high level,
the goal is to create an optional parameter so that code which the DAG calls
can define a default. Without the null option, the parameter must be specified
in the DAG parameters to be able to load the DAG (due to default validation).
Thanks for the detailed explanation @mblakely!
So in my words if I correctly understand you want to define a parameter as
you wrap a DAG around some existing function. That function receives a boolean
parameter but you want to have the option to call also without these parameters.
Is your requirement only "I want to call w/o need to define all parameters"
or is your wrapper required to "I need to distinguish three cases for
boolean=[True,False,None]"?
If you are using `type=["string, "null"]` and `type=["boolean", "null"]`
just to prevent that a caller need to pass all parameter values, then you could
assign just default values like:
```
with DAG(
"process_data"
params={
"image_directory": Param("/path/to/a/shared/directory", type="string"),
"should_parallelize": Param(True, type="boolean")
}
...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]