You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/11/07 08:47:17 UTC

[GitHub] [airflow] ephraimbuddy commented on issue #27509: Removing DAG dataset dependency when it is already ready results in SQLAlchemy cascading delete error

ephraimbuddy commented on issue #27509:
URL: https://github.com/apache/airflow/issues/27509#issuecomment-1305272978

   Reproduced with:
   ```python
    def test_dataset_cascade_deletion(self,dag_maker, session):
         from airflow.decorators import task
         
         with dag_maker(schedule=None, serialized=True) as dag1:
             @task(outlets=Dataset('test/1'))
             def test_task1():
                 print(1)
             test_task1()
         
         dr1 = dag_maker.create_dagrun()
         test_task1 = dag1.get_task('test_task1')
   
         with dag_maker(dag_id='testdag', schedule=[Dataset('test/1')], serialized=True) as dag2:
             @task
             def test_task2():
                 print(1)
             test_task2()
         
         ti = dr1.get_task_instance(task_id='test_task1')
         ti.run()
         # Change the dataset.
         with dag_maker(dag_id='testdag', schedule=[Dataset('test2/1')], serialized=True) as dag2:
             @task
             def test_task2():
                 print(1)
             test_task2()
   ```
   on it.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org