jedcunningham commented on code in PR #32684:
URL: https://github.com/apache/airflow/pull/32684#discussion_r1267344840
##########
airflow/www/utils.py:
##########
@@ -844,12 +847,17 @@ class DagRunCustomSQLAInterface(CustomSQLAInterface):
"""
def delete(self, item: Model, raise_exception: bool = False) -> bool:
- self.session.execute(delete(TaskInstance).where(TaskInstance.run_id ==
item.run_id))
+ self.session.execute(delete(TI).where(TI.dag_id == item.dag_id and
TI.run_id == item.run_id))
Review Comment:
```suggestion
self.session.execute(delete(TI).where(TI.dag_id == item.dag_id,
TI.run_id == item.run_id))
```
##########
airflow/www/utils.py:
##########
@@ -844,12 +847,17 @@ class DagRunCustomSQLAInterface(CustomSQLAInterface):
"""
def delete(self, item: Model, raise_exception: bool = False) -> bool:
- self.session.execute(delete(TaskInstance).where(TaskInstance.run_id ==
item.run_id))
+ self.session.execute(delete(TI).where(TI.dag_id == item.dag_id and
TI.run_id == item.run_id))
return super().delete(item, raise_exception=raise_exception)
def delete_all(self, items: list[Model]) -> bool:
self.session.execute(
- delete(TaskInstance).where(TaskInstance.run_id.in_(item.run_id for
item in items))
+ delete(TaskInstance).where(
Review Comment:
```suggestion
delete(TI).where(
```
--
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]