jens-scheffler-bosch opened a new issue, #31299:
URL: https://github.com/apache/airflow/issues/31299

   ### Apache Airflow version
   
   2.6.0
   
   ### What happened
   
   While trying to debug other things I stumbled over the function 
`DAG.validate_schedule_and_params()` which is used in the constructor of the 
DAG class. This function validates all DAG `params` for JSON Schema correctness 
- but only if the trigger condition is not set to manual. From point of code I 
understood that this is made especially to have a valid DAG but validate 
`params` at time of triggering.
   
   I tried to apply this as a "feature" in the Trigger UI Forms from AIP-50 and 
realized that DAG parsing in `dagbag.py:444` calls `dag.validate()` which still 
does a full validation. So the DAG can not be rendered if `params` are not 
valid against JSON Schema.
   
   ### What you think should happen instead
   
   So if we have a manual triggered DAG it would be cool to relax `param` 
validation and check on submission. This would allow to define required fields 
and enforce a user to prove content w/o having a default and the user just hits 
"Trigger".
   
   Besides this it makes the constructor and the `dag.validate()` call 
consistent in regards of checks.
   
   ### How to reproduce
   
   Run your Airflow instance and edit 
`airflow/example_dags/example_params_ui_tutorial.py` in line 108 for example 
and set the default value of `required_field` to `None`. You will get a DAG 
parsing error even the DAG is manually triggered.
   
   ### Operating System
   
   Ubuntu 20.04
   
   ### Versions of Apache Airflow Providers
   
   defaults
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   Standard Docker deployment of Airflow 2.6.0
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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]

Reply via email to