potiuk commented on a change in pull request #10956:
URL: https://github.com/apache/airflow/pull/10956#discussion_r499554188



##########
File path: airflow/models/pool.py
##########
@@ -91,7 +96,15 @@ def slots_stats(session: Session = None) -> Dict[str, 
PoolStats]:
 
         pools: Dict[str, PoolStats] = {}
 
-        pool_rows: Iterable[Tuple[str, int]] = session.query(Pool.pool, 
Pool.slots).all()
+        query = session.query(Pool.pool, Pool.slots)

Review comment:
       Those parameter names and the way the if's here are done are pretty 
confusing. "with_for_update" can be method in query, function, bool or dict and 
it's unclear why we need dict at all. Could we make the code a bit more 
readable and make it clear why we need for update in one place, but we do not 
need it in another? I think this all can be achieved by a single bool 
("use_for_update") parameter ?




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to