ashb commented on a change in pull request #5998: [AIRFLOW-5398] Update contrib 
example DAGs to context manager
URL: https://github.com/apache/airflow/pull/5998#discussion_r321738411
 
 

 ##########
 File path: airflow/contrib/example_dags/example_azure_cosmosdb_sensor.py
 ##########
 @@ -41,24 +41,25 @@
     'email_on_retry': False
 }
 
-dag = DAG('example_azure_cosmosdb_sensor', default_args=default_args)
+with DAG(
+    dag_id='example_azure_cosmosdb_sensor',
+    default_args=default_args
+) as dag:
 
 Review comment:
   Turns out this does work and I mis-understoon python's scoping rules.
   
   Please keep the doc_md -- that will show up in the UI. It can be passed as 
an kwarg to `DAG()` though

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