[ 
https://issues.apache.org/jira/browse/AIRFLOW-3717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16744515#comment-16744515
 ] 

Tao Feng commented on AIRFLOW-3717:
-----------------------------------

Thanks [~SteveGreenberg] , agree we should encourage to use context manager to 
write DAG. Feel free to submit a pr to fix it.

> Refactor sample DAGs to use context manager
> -------------------------------------------
>
>                 Key: AIRFLOW-3717
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3717
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Steve Greenberg
>            Priority: Minor
>
> Tutorial code says: 
>  
> ```
> import airflow
> from airflow import DAG
>  
> dag = DAG(
> ...
> ```
>  
> The context manager saves users the need to pass the dag parameter to each 
> operator. 
>  
> So we should encourage: 
>  
> ```
> from airflow import models
>  
> with models.DAG(
> ...
> ```
> instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to