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

 ##########
 File path: airflow/contrib/example_dags/example_winrm_operator.py
 ##########
 @@ -37,39 +37,40 @@
 from airflow.models import DAG
 from airflow.operators.dummy_operator import DummyOperator
 
-args = {
+
+default_args = {
     'owner': 'Airflow',
     'start_date': airflow.utils.dates.days_ago(2)
 }
 
-dag = DAG(
-    dag_id='POC_winrm_parallel', default_args=args,
+with DAG(
+    dag_id='POC_winrm_parallel',
+    default_args=default_args,
     schedule_interval='0 0 * * *',
-    dagrun_timeout=timedelta(minutes=60))
+    dagrun_timeout=timedelta(minutes=60)
+) as dag:
 
-cmd = 'ls -l'
-run_this_last = DummyOperator(task_id='run_this_last', dag=dag)
+    cmd = 'ls -l'
+    run_this_last = DummyOperator(task_id='run_this_last', dag=dag)
 
 Review comment:
   ```suggestion
       run_this_last = DummyOperator(task_id='run_this_last')
   ```

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