sean-rose commented on code in PR #29065:
URL: https://github.com/apache/airflow/pull/29065#discussion_r1084283710


##########
tests/models/test_cleartasks.py:
##########
@@ -202,9 +203,9 @@ def test_clear_task_instances_without_task(self, dag_maker):
             # but it works for our case because we specifically constructed 
test DAGS
             # in the way that those two sort methods are equivalent
             qry = session.query(TI).filter(TI.dag_id == 
dag.dag_id).order_by(TI.task_id).all()
-            clear_task_instances(qry, session)
+            clear_task_instances(qry, session, dag=dag)

Review Comment:
   It wasn't failing outright, but it wasn't testing the intended logic.  With 
no DAG passed in it was essentially testing the exact same codepath as 
`test_clear_task_instances_without_dag`, where it short circuited [this 
conditional](https://github.com/apache/airflow/blob/c0f6bfa35b82f9a756b31bbba739c9918a28c771/airflow/models/taskinstance.py#L193)
 and never ran `dag.has_task(task_id)`.



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to