uranusjr commented on a change in pull request #15585:
URL: https://github.com/apache/airflow/pull/15585#discussion_r622996974



##########
File path: airflow/models/pool.py
##########
@@ -161,12 +161,13 @@ def occupied_slots(self, session: Session):
         """
         from airflow.models.taskinstance import TaskInstance  # Avoid circular 
import
 
-        return (
+        return int(
             session.query(func.sum(TaskInstance.pool_slots))
             .filter(TaskInstance.pool == self.pool)
             .filter(TaskInstance.state.in_(list(EXECUTION_STATES)))
             .scalar()
-        ) or 0
+            or 0

Review comment:
       This is the implementation, there's no magic at all. I guess the SO 
answer is inaccurate.
   
   
https://github.com/sqlalchemy/sqlalchemy/blob/b703a9c1be728077e4709c377b0b29a94c052a0b/lib/sqlalchemy/orm/query.py#L2818-L2824




-- 
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:
us...@infra.apache.org


Reply via email to