I create my Airflow DAGs as follows:
dag = DAG(...)
But in multiple tutorials and course I see that they use the with ... as
clause like this:
with DAG(...) as dag:
# Code that will use the dag variable.
I guess this way, the DAG instances will be destroyed after the scheduler executes the code block, but is there a real benefit in doing so? I can't find any documentation talking about this.