uranusjr commented on code in PR #34763:
URL: https://github.com/apache/airflow/pull/34763#discussion_r1346773871


##########
airflow/ti_deps/deps/pool_slots_available_dep.py:
##########
@@ -41,8 +43,7 @@ def _get_dep_statuses(self, ti, session, dep_context=None):
         from airflow.models.pool import Pool  # To avoid a circular dependency
 
         pool_name = ti.pool
-
-        pools = session.query(Pool).filter(Pool.pool == pool_name).all()
+        pools = session.scalars(select(Pool).where(Pool.pool == 
pool_name)).all()

Review Comment:
   This can be rewritten as
   
   ```python
   pool = session.scalar(select(Pool).where(Pool.pool == pool_name))
   if pool is None:
       yield ...
       return
   # Replace "pools[0]" with "pool"...



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to