josh-fell commented on a change in pull request #18562:
URL: https://github.com/apache/airflow/pull/18562#discussion_r720362346



##########
File path: airflow/example_dags/example_trigger_target_dag.py
##########
@@ -24,11 +24,12 @@
 from datetime import datetime
 
 from airflow import DAG
+from airflow.decorators import task
 from airflow.operators.bash import BashOperator
-from airflow.operators.python import PythonOperator
 
 
-def run_this_func(dag_run):
+@task(task_id="run_this")
+def run_this_func(dag_run=None):

Review comment:
       I see, good point. I feel it's better to show that you don't need to 
explicitly pass in the `dag_run` object (any context object for that matter) 
when using the TaskFlow API (hoping it's another example that makes the 
TaskFlow API more approachable). I think updating the access method would be a 
better move.




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