You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Steve Greenberg (JIRA)" <ji...@apache.org> on 2019/01/16 20:59:00 UTC

[jira] [Created] (AIRFLOW-3717) Refactor sample DAGs to use context manager

Steve Greenberg created AIRFLOW-3717:
----------------------------------------

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


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)