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 2019/03/11 13:49:11 UTC

[GitHub] [airflow] ashb commented on a change in pull request #4603: [AIRFLOW-3717] Use DAG context managers in documentation examples

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:
users@infra.apache.org


With regards,
Apache Git Services