Prab-27 commented on code in PR #59748:
URL: https://github.com/apache/airflow/pull/59748#discussion_r2643919786


##########
airflow-core/tests/unit/dag_processing/test_manager.py:
##########
@@ -485,38 +485,32 @@ def test_scan_stale_dags(self, session):
         manager._files = [test_dag_path]
         manager._file_stats[test_dag_path] = stat
 
-        active_dag_count = (
-            session.query(func.count(DagModel.dag_id))
-            .filter(
+        active_dag_count = session.scalars(
+            select(func.count(DagModel.dag_id)).where(
                 ~DagModel.is_stale,
                 DagModel.relative_fileloc == str(test_dag_path.rel_path),
                 DagModel.bundle_name == test_dag_path.bundle_name,
             )
-            .scalar()
-        )
-        assert active_dag_count == 1
+        ).all()
+        assert active_dag_count == [1]

Review Comment:
   what if we use `scalar()` directly  -  `session.scalar(select().where())` 
and `assert active_dag_count == 1`
   
   since `scalar()` returns single value , we don't need to create a list
   
   What do you think ? 



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