ashb commented on a change in pull request #4603: [AIRFLOW-3717] Use DAG 
context managers in documentation examples
URL: https://github.com/apache/airflow/pull/4603#discussion_r264239666
 
 

 ##########
 File path: docs/concepts.rst
 ##########
 @@ -759,25 +759,22 @@ For example, consider the following dag:
   from airflow.utils.trigger_rule import TriggerRule
 
 
-  dag = DAG(
-      dag_id='latest_only_with_trigger',
-      schedule_interval=dt.timedelta(hours=4),
-      start_date=dt.datetime(2016, 9, 20),
-  )
+  with DAG(dag_id='latest_only_with_trigger',
+           schedule_interval=dt.timedelta(hours=4),
+           start_date=dt.datetime(2016, 9, 20)) as dag:
 
 Review comment:
   Do we need the `as dag` if we don't reference it inside the block anywhere? 
(I think this would cause a warning from flake8 if it this code was run through 
it?)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to