uranusjr commented on code in PR #34665:
URL: https://github.com/apache/airflow/pull/34665#discussion_r1343835869


##########
airflow/dag_processing/manager.py:
##########
@@ -547,11 +546,13 @@ def deactivate_stale_dags(
                 to_deactivate.add(dag.dag_id)
 
         if to_deactivate:
-            deactivated = (
-                session.query(DagModel)
-                .filter(DagModel.dag_id.in_(to_deactivate))
-                .update({DagModel.is_active: False}, 
synchronize_session="fetch")
+            deactivated_dagmodel = session.execute(
+                update(DagModel)
+                .where(DagModel.dag_id.in_(to_deactivate))
+                .values(is_active=False)
+                .execution_options(synchronize_session="fetch")
             )
+            deactivated = len([dagmodel for dagmodel, in deactivated_dagmodel])

Review Comment:
   Yes, please use `.rowcount` here. There are various examples if you search 
for this.



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