Skip to content

Commit c568874

Browse files
authored
Fix task id when making the mapped task label in graph view (apache#28993)
1 parent 65010fd commit c568874

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

airflow/www/static/js/graph.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ const updateNodeLabels = (node, instances) => {
9090
let { label } = node.value;
9191
// Check if there is a count of mapped instances
9292
if ((tasks[node.id] && tasks[node.id].is_mapped) || node.value.isMapped) {
93-
const firstChildId = node.children[0].id;
93+
const id = !!node.children && node.children.length ? node.children[0].id : node.value.id;
9494

9595
let count = ' ';
9696

9797
// get count from mapped_states or the first child's mapped_states
9898
// TODO: update this count for when we can nest mapped tasks inside of mapped task groups
9999
if (instances[node.id] && instances[node.id].mapped_states) {
100100
count = instances[node.id].mapped_states.length;
101-
} else if (firstChildId && instances[firstChildId]) {
102-
count = instances[firstChildId].mapped_states.length;
101+
} else if (id && instances[id]) {
102+
count = instances[id].mapped_states.length;
103103
}
104104

105105
if (!label.includes(`[${count}]`)) {

0 commit comments

Comments
 (0)