Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions airflow-core/src/airflow/ui/src/components/PoolBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,22 @@ export const PoolBar = ({
return undefined;
}

// is configured NOT to include deferred in occupied slots, hide this chip.
// (We only have the flag on real pools; aggregated "Slots" objects don't carry it)
const isDeferredKey = key === "deferred_slots";

if (
isDeferredKey &&
"include_deferred" in pool && // type guard: only PoolResponse has this
!pool.include_deferred
) {
return undefined;
}

const slotType = key.replace("_slots", "");
const poolCount = poolsWithSlotType ? poolsWithSlotType[key] : 0;
const tooltipContent = `${translate(`pools.${slotType}`)}: ${slotValue} (${poolCount} ${translate("pools.pools", { count: poolCount })})`;

const poolContent = (
<Tooltip content={tooltipContent} key={key}>
<Flex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const PoolSummary = () => {

const pools = data?.pools;
const totalSlots = pools?.reduce((sum, pool) => sum + pool.slots, 0) ?? 0;

const aggregatePool: Slots = {
deferred_slots: 0,
open_slots: 0,
Expand All @@ -58,6 +59,11 @@ export const PoolSummary = () => {
slotKeys.forEach((slotKey) => {
const slotValue = pool[slotKey];

// NEW: only include deferred slots from pools that count deferred
if (slotKey === "deferred_slots" && !pool.include_deferred) {
return;
}

if (slotValue > 0) {
aggregatePool[slotKey] += slotValue;
poolsWithSlotType[slotKey] += 1;
Expand Down