vincbeck commented on code in PR #62751:
URL: https://github.com/apache/airflow/pull/62751#discussion_r2878823907


##########
airflow-core/src/airflow/models/serialized_dag.py:
##########
@@ -599,7 +599,12 @@ def write_dag(
         has_task_instances: bool = False
         if dag_version:
             has_task_instances = bool(
-                
session.scalar(select(exists().where(TaskInstance.dag_version_id == 
dag_version.id)))
+                session.scalar(
+                    select(exists().where(
+                        TaskInstance.dag_id == dag.dag_id,
+                        TaskInstance.dag_version_id == dag_version.id,

Review Comment:
   Maybe add a comment so that we remember why we have this filter?



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