bbovenzi commented on code in PR #55857:
URL: https://github.com/apache/airflow/pull/55857#discussion_r2372876878
##########
airflow-core/src/airflow/ui/src/components/PoolBar.tsx:
##########
@@ -42,13 +42,28 @@ export const PoolBar = ({
const slotValue = pool[key];
const flexValue = slotValue / totalSlots || 0;
+ // Hide empty segments
Review Comment:
Let's not add excess comments.
##########
airflow-core/src/airflow/ui/src/components/PoolBar.tsx:
##########
@@ -42,13 +42,28 @@ export const PoolBar = ({
const slotValue = pool[key];
const flexValue = slotValue / totalSlots || 0;
+ // Hide empty segments
if (flexValue === 0) {
return undefined;
}
+ // NEW: If this segment represents "deferred_slots" and the current
pool
+ // 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
Review Comment:
Annoyingly the type is `PoolResponse | Slots` so this is ok
##########
airflow-core/src/airflow/ui/src/components/PoolBar.tsx:
##########
@@ -42,13 +42,28 @@ export const PoolBar = ({
const slotValue = pool[key];
const flexValue = slotValue / totalSlots || 0;
+ // Hide empty segments
if (flexValue === 0) {
return undefined;
}
+ // NEW: If this segment represents "deferred_slots" and the current
pool
+ // 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
Review Comment:
The exclamation point is the correct usage to see that include_deferred =
false
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]