You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/08/16 23:55:24 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #25657: Update code examples from "classic" operators to TaskFlow decorators (faq, best practices, index)

uranusjr commented on code in PR #25657:
URL: https://github.com/apache/airflow/pull/25657#discussion_r947336092


##########
docs/apache-airflow/faq.rst:
##########
@@ -195,7 +191,12 @@ until ``min_file_process_interval`` is reached since DAG Parser will look for mo
         )
 
         with dag:
-            t1 = PythonOperator(task_id="hello_world", python_callable=hello_world_py)
+            @task()
+            def hello_world():
+                print("Hello World")
+                print("This is DAG: {}".format(str(dag_number)))

Review Comment:
   ```suggestion
                   print(f"This is DAG: {dag_number}")
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org