jsgh7276 opened a new issue, #32859:
URL: https://github.com/apache/airflow/issues/32859

   ### Apache Airflow version
   
   2.6.3
   
   ### What happened
   
   I've found some unexpected behaviors of airflow webserver UI, when visiting 
DAG triggering page with `conf`  in the URL query string.
   
   1. `conf` in the URL is not applied to the triggering page param text input.
   2. Cannot edit the actual DagRun conf when I trigger the DAG from triggering 
page with `conf` in the URL query string.
   
   I have this simple DAG below, and I wanted to guide coworkers to trigger 
this DAG with specific conf included.
   ```
   with DAG(
           dag_id="example_dag",
           default_args={
               "depends_on_past": False,
               "wait_for_downstream": False,
               "email_on_failure": False,
               "email_on_retry": False
           },
           description="This is example dag",
           start_date=datetime(2023, 6, 2),
           schedule=None,
           catchup=False,
           params={
               "key1": "default value 1",
               "key2": "default value 2"
           }
   ) as dag:
   
       t1 = BashOperator(
           task_id="example_task",
           bash_command="echo hello"
       )
   
       t1
   
   ```
   So I provided the triggering URL 
`http://webserver.url:8080/trigger?dag_id=example_dag&conf={"key1":"value1","key2":"value2"}`.
   But when visiting the URL, UI does not reflect the passed conf parameter in 
the query string.
   
   As you can see in the screenshot below, pre-populated texts are just showing 
default params of the DAG, not the conf in the URL query.
   
![image](https://github.com/apache/airflow/assets/34760655/aaff99c4-b4af-40ea-b5ff-782f5adb03a3)
   
   Moreover, when I trigger the DAG by clicking the blue button in the above 
page, that DagRun gets conf in the URL query string. In other words, text input 
in the triggering page does not affect DagRun when the user visit the page with 
conf query string included. (This problem was also reproduced on airflow 
version 2.5.2)
   
   
   ### What you think should happen instead
   
   I suggest the text input in triggering page should reflect the passed conf 
in the query string.
   Also, when the DagRun is triggered at the triggering page where conf is 
included in URL, I think DagRun should utilize conf in the text input, not in 
the URL.
   
   ### How to reproduce
   
   It is reproducible with above DAG example and the example 
URL(http://webserver.url:8080/trigger?dag_id=example_dag&conf={"key1":"value1","key2":"value2"}).
   
   ### Operating System
   
   CentOS Linux, MacOS
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-common-sql==1.5.1
   apache-airflow-providers-ftp==3.4.1
   apache-airflow-providers-http==4.4.1
   apache-airflow-providers-imap==3.2.1
   apache-airflow-providers-mysql==4.0.2
   apache-airflow-providers-sqlite==3.4.1
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### 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