Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not calculate grid root instances #24528

Merged
merged 2 commits into from
Jun 17, 2022
Merged
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
9 changes: 9 additions & 0 deletions airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,15 @@ def get_summary(dag_run, children):
'end_date': group_end_date,
}

# We don't need to calculate summaries for the root
if task_group.group_id is None:
return {
'id': task_group.group_id,
'label': task_group.label,
'children': children,
'instances': [],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will not having label here confuse your Typescript changes in the UI?

}

group_summaries = [get_summary(dr, children) for dr in dag_runs]

return {
Expand Down
19 changes: 1 addition & 18 deletions tests/www/views/test_views_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ def test_no_runs(admin_client, dag_without_runs):
'id': None,
'instances': [],
'label': None,
'tooltip': '',
},
}

Expand Down Expand Up @@ -249,24 +248,8 @@ def test_one_run(admin_client, dag_with_runs: List[DagRun], session):
},
],
'id': None,
'instances': [
{
'end_date': None,
'run_id': 'run_1',
'start_date': None,
'state': 'success',
'task_id': None,
},
{
'end_date': '2021-07-01T01:02:03+00:00',
'run_id': 'run_2',
'start_date': '2021-07-01T01:00:00+00:00',
'state': 'running',
'task_id': None,
},
],
'instances': [],
'label': None,
'tooltip': '',
},
}

Expand Down