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

demote Removed state in priority for displaying task summaries #26789

Merged
merged 1 commit into from Sep 30, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 1 addition & 7 deletions airflow/www/static/js/graph.js
Expand Up @@ -21,7 +21,7 @@

/*
global d3, document, nodes, taskInstances, tasks, edges, dagreD3, localStorage, $,
autoRefreshInterval, moment, convertSecsToHumanReadable
autoRefreshInterval, moment, convertSecsToHumanReadable, priority
*/

import { getMetaValue, finalStatesMap } from './utils';
Expand Down Expand Up @@ -600,12 +600,6 @@ function getNodeState(nodeId, tis) {
}
});

// In this order, if any of these states appeared in childrenStates, return it as
// the group state.
const priority = ['failed', 'upstream_failed', 'up_for_retry', 'up_for_reschedule',
'queued', 'scheduled', 'running', 'shutdown', 'restarting', 'removed',
'no_status', 'success', 'skipped'];

return priority.find((state) => childrenStates.has(state)) || 'no_status';
}

Expand Down
1 change: 1 addition & 0 deletions airflow/www/templates/airflow/graph.html
Expand Up @@ -136,6 +136,7 @@
const tasks = {{ tasks|tojson }};
let taskInstances = {{ task_instances|tojson }};
const autoRefreshInterval = {{ auto_refresh_interval }};
const priority = {{ state_priority|tojson }};
</script>
<script src="{{ url_for_asset('d3.min.js') }}"></script>
<script src="{{ url_for_asset('dagre-d3.min.js') }}"></script>
Expand Down
2 changes: 1 addition & 1 deletion airflow/www/utils.py
Expand Up @@ -93,10 +93,10 @@ def get_instance_with_map(task_instance, session):
TaskInstanceState.RUNNING,
TaskInstanceState.SHUTDOWN,
TaskInstanceState.RESTARTING,
TaskInstanceState.REMOVED,
None,
TaskInstanceState.SUCCESS,
TaskInstanceState.SKIPPED,
TaskInstanceState.REMOVED,
]


Expand Down
3 changes: 3 additions & 0 deletions airflow/www/views.py
Expand Up @@ -2810,6 +2810,8 @@ class GraphForm(DateTimeWithNumRunsWithDagRunsForm):
else:
external_log_name = None

state_priority = ['no_status' if p is None else p for p in wwwutils.priority]

return self.render_template(
'airflow/graph.html',
dag=dag,
Expand All @@ -2832,6 +2834,7 @@ class GraphForm(DateTimeWithNumRunsWithDagRunsForm):
dag_run_state=dt_nr_dr_data['dr_state'],
dag_model=dag_model,
auto_refresh_interval=conf.getint('webserver', 'auto_refresh_interval'),
state_priority=state_priority,
)

@expose('/duration')
Expand Down