uranusjr commented on a change in pull request #18434:
URL: https://github.com/apache/airflow/pull/18434#discussion_r713958136



##########
File path: airflow/models/dagrun.py
##########
@@ -124,7 +124,7 @@ class DagRun(Base, LoggingMixin):
         ),
     )
 
-    task_instances = relationship(TI, back_populates="dag_run")
+    task_instances = relationship(TI, back_populates="dag_run", cascade='all, 
delete, delete-orphan')

Review comment:
       According to documentation `all` implies `delete` so the latter is not 
needed. However, I don’t think we should do `expunge` (also implied by `all`). 
I’m also not sure about `refresh-expire`. Maybe a safer route would be 
`save-update, merge, delete, delete-orphan` (the first two are the default 
value).
   
   
https://docs.sqlalchemy.org/en/14/orm/relationship_api.html#sqlalchemy.orm.relationship.params.cascade




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