Skip to content

Commit

Permalink
Correctly interpolate pool name in PoolSlotsAvailableDep statues (#22…
Browse files Browse the repository at this point in the history
…807)

GitOrigin-RevId: 05eb49fea61aa5952be94aeb1e5105cd9ce05a46
  • Loading branch information
tanelk authored and Cloud Composer Team committed Sep 12, 2024
1 parent 26c8cc5 commit 9e6b45e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions airflow/ti_deps/deps/pool_slots_available_dep.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _get_dep_statuses(self, ti, session, dep_context=None):
pools = session.query(Pool).filter(Pool.pool == pool_name).all()
if not pools:
yield self._failing_status(
reason=("Tasks using non-existent pool '%s' will not be scheduled", pool_name)
reason=f"Tasks using non-existent pool '{pool_name}' will not be scheduled"
)
return
else:
Expand All @@ -59,14 +59,10 @@ def _get_dep_statuses(self, ti, session, dep_context=None):

if open_slots <= (ti.pool_slots - 1):
yield self._failing_status(
reason=(
"Not scheduling since there are %s open slots in pool %s and require %s pool slots",
open_slots,
pool_name,
ti.pool_slots,
)
reason=f"Not scheduling since there are {open_slots} open slots in pool {pool_name} "
f"and require {ti.pool_slots} pool slots"
)
else:
yield self._passing_status(
reason=("There are enough open slots in %s to execute the task", pool_name)
reason=f"There are enough open slots in {pool_name} to execute the task",
)

0 comments on commit 9e6b45e

Please sign in to comment.