kaxil commented on code in PR #54383:
URL: https://github.com/apache/airflow/pull/54383#discussion_r2301720815


##########
devel-common/src/tests_common/test_utils/db.py:
##########
@@ -72,8 +74,22 @@
     from airflow.models.dag_favorite import DagFavorite
 
 
+def _deactivate_unknown_dags(active_dag_ids, session):
+    """
+    Given a list of known DAGs, deactivate any other DAGs that are marked as 
active in the ORM.
+
+    :param active_dag_ids: list of DAG IDs that are active
+    :return: None
+    """
+    if not active_dag_ids:
+        return
+    for dag in 
session.scalars(select(DagModel).where(~DagModel.dag_id.in_(active_dag_ids))):
+        dag.is_stale = True
+        session.merge(dag)
+    session.commit()

Review Comment:
   Should this just be on DagModel?



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