jens-scheffler-bosch commented on code in PR #31301:
URL: https://github.com/apache/airflow/pull/31301#discussion_r1223453617


##########
airflow/example_dags/example_params_ui_tutorial.py:
##########
@@ -278,13 +276,8 @@
     },
 ) as dag:
 
-    @task(task_id="show_params")
-    def show_params(**kwargs) -> None:
-        ti: TaskInstance = kwargs["ti"]
-        dag_run: DagRun = ti.dag_run
-        if not dag_run.conf:
-            print("Uups, no parameters supplied as DagRun.conf, was the 
trigger w/o form?")
-            raise AirflowSkipException("No DagRun.conf parameters supplied.")
-        print(f"This DAG was triggered with the following 
parameters:\n{json.dumps(dag_run.conf, indent=4)}")
+    @task
+    def show_params(params: ParamsDict = dag.params) -> None:
+        print(f"This DAG was triggered with the following 
parameters:\n\n{json.dumps(params, indent=4)}\n")

Review Comment:
   I'd propose to leave it rather with `params` as this tutorial DAG is for 
`params` actually. Users learning Airflow via this tutorial might be confused 
with `dag_run.conf` and if users have doubts then I'd propose to user `params` 
- because they will have a form and also be validated and have defaults as 
fallback - so generate less problems.



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