You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jens-scheffler-bosch (via GitHub)" <gi...@apache.org> on 2023/05/15 21:21:30 UTC

[GitHub] [airflow] jens-scheffler-bosch opened a new issue, #31299: Params Definition is Required to ve JSON Schema Valid also if Manually Triggered

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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ricardogaspar2 commented on issue #31299: Params Definition is Required to be JSON Schema Valid also if Manually Triggered

Posted by "ricardogaspar2 (via GitHub)" <gi...@apache.org>.
ricardogaspar2 commented on issue #31299:
URL: https://github.com/apache/airflow/issues/31299#issuecomment-1552747158

   Yeah we much needed a `required` like field to relax the new params
   Thanks for doing this


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Params Definition is Required to be JSON Schema Valid also if Manually Triggered [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed issue #31299: Params Definition is Required to be JSON Schema Valid also if Manually Triggered
URL: https://github.com/apache/airflow/issues/31299


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org