The current code of dag examples is in the form of:
dag = DAG(whatever)
task_1 = Operator(task_id='dfsa',
dag=dag)
As it is said in the docs (or in some article written by a commiter somewhere) it is better to have:
with DAG(whatever):
I don't have time right now to make the changes