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


##########
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:
   Is this change necessary? Can't we print the output of `dag_run.conf`?



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