safaehar commented on code in PR #75216:
URL: https://github.com/apache/airflow/pull/75216#discussion_r4413535003


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/pools.py:
##########
@@ -119,10 +140,16 @@ def get_pools(
         session=session,
     )
 
-    pools = session.scalars(pools_select)
+    pools = session.scalars(pools_select).all()
+    pool_stats = Pool.slots_stats(session=session)

Review Comment:
   Good point, thanks. I updated the implementation so both pool and 
task-instance statistics are restricted to the pools in the returned page, so 
empty pages now skip statistics aggregation entirely
   
   i added too regression tests that verify the aggregation query is scoped to 
the selected pool names and that no task-instance query runs for an empty page



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