kaxil commented on a change in pull request #15585: URL: https://github.com/apache/airflow/pull/15585#discussion_r622980931
########## 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: Interesting I thought `.scalar()` should take care of it based on https://stackoverflow.com/a/53431701/5691525 too -- 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