-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Required Param
requires None
to be explicitly passed as default
#28940
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
None
to be explicitly passed from command line if it is a required argument
None
to be explicitly passed from command line if it is a required argumentNone
to be explicitly passed as default
None
to be explicitly passed as defaultParam
requires None
to be explicitly passed as default
Marked it as good first issue. Hopefully somoene will fix it soon (but it's up for grabs for you if you would like to fix it ). PRs are most welcome to fix it. |
For me it make sense. If no default value provided than parameter is a mandatory, and otherwise if default parameter provided than parameter is optional |
I agree with @Taragolis, we should check if the required parameters (with no default value) are provided or not, and fail the dag run if they are not provided. |
It seems like currently we don't support required params, to fix this, I think we need to differentiate between parsing the params during the dag parsing/creation and parsing the params during the dag run execution. During the dag parsing, we should not raise an exception if the default is not provided because this param is defined as required param. But during the dag run execution, if the param is required and the value is not provided, we should raise an exception to fail the dag run or the task if the params are defined at the task level. I don't think this is a good first issue. |
Sure. Removed the label then |
This is even worse for the case of a |
There had been a couple of PRs by me, for example #31301 and #34248 which handle optional fields and how Params are handled for this. Just got note of this bug report and must state after a manual re-test: Can not be re-produced. Did not explicitly test but might have been resolved in 2.8.0 already. Therefore closing. |
Apache Airflow version
2.5.0
What happened
I have a dag like
I am trying to pass this param via CLI. I tried passing it like
gives
Note
Found out that you need to explicitly pass
None
as the default, otherwise it will crash with above.What you think should happen instead
month
should be passed to the dagHow to reproduce
No response
Operating System
mac osx
Versions of Apache Airflow Providers
No response
Deployment
Virtualenv installation
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: