eladkal commented on issue #16697:
URL: https://github.com/apache/airflow/issues/16697#issuecomment-1300064404

   Using the DAG code as shared by the author will show broken dag message
   ![Screen Shot 2022-11-02 at 12 58 
02](https://user-images.githubusercontent.com/45845474/199472808-05e598bb-cc04-4621-83a7-2e84c3445556.png)
   
   However if using the code as:
   ```
   default_args = {
       'owner': 'airflow',
       'start_date': datetime(2017, 2, 1)
   }
   with DAG('my_dag', default_args=default_args):
       DummyOperator(task_id='dummy')
   ```
   It will work
   ![Screen Shot 2022-11-02 at 13 01 
16](https://user-images.githubusercontent.com/45845474/199473353-02a5f0dd-5f98-460e-bb56-e8d1bde02528.png)
   
   In our examples we never show usage of `dag.add_task()` and I'm not sure why 
this is needed here?
   Since the recommended way to use context manager and this is working fine 
I'm closing this issue.
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to