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

ASF GitHub Bot commented on AIRFLOW-3717:
-----------------------------------------

elvijs commented on pull request #4603: [AIRFLOW-3717] Use DAG context managers 
in documentation examples
URL: https://github.com/apache/airflow/pull/4603
 
 
   ### Jira
   
   This PR addresses 
[AIRFLOW-3717](https://issues.apache.org/jira/browse/AIRFLOW-3717).
   
   ### Description
   
   This is a trivial refactor of the documentation examples to use the DAG 
context manager where appropriate.
   
   Note that my editor automatically removes unnecessary trailing whitespace, 
hope that's not a problem.
   
   ### Tests
   
   No additional tests have been added as it's documentation. I've built the 
docs locally and manually inspected the changes to ensure no fat-finger errors.
   
   ### Commits
   
   There's a single commit with the subject line referencing the JIRA issue.
   
   ### Documentation
   
   There's no new functionality, so no additional documentation has been added.
   
   ### Code Quality
   
   - [X] Passes `flake8`. Although strictly speaking, probably not necessary as 
no new code has been added.
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> 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