ephraimbuddy commented on code in PR #31301:
URL: https://github.com/apache/airflow/pull/31301#discussion_r1221151928


##########
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:
   In my understanding, the purpose of the task was to show how you can get 
information from dag_run.conf and possibly use it in the dag. What do you think 
about showing both examples? No strong opinion though



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