uranusjr commented on code in PR #41384:
URL: https://github.com/apache/airflow/pull/41384#discussion_r1728767974
##########
tests/models/test_dag.py:
##########
@@ -3429,8 +3429,8 @@ def consumer(value):
state=TaskInstanceState.SUCCESS,
session=session,
)
- assert dr1 in session, "Check session is passed down all the way"
-
+ dag_runs = session.query(DagRun).filter(DagRun.run_id == dr1.run_id).all()
+ assert len(dag_runs) > 0, "Check session is passed down all the way"
Review Comment:
We can use `func.count()` here to improve performance. This doesn’t matter
that much since this is just a test (and if `all()` returns anything to cause
performance issues, we should fix it anyway) but that’s good practice.
--
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]