Skip to content

Commit

Permalink
Fix task instances list link (apache#38096)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbovenzi authored and howardyoo committed Mar 31, 2024
1 parent b807e2f commit 4922444
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions airflow/www/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ def task_instance_link(attr):
"""Generate a URL to the Graph view for a TaskInstance."""
dag_id = attr.get("dag_id")
task_id = attr.get("task_id")
run_id = attr.get("run_id")
execution_date = attr.get("dag_run.execution_date") or attr.get("execution_date") or timezone.utcnow()
url = url_for(
"Airflow.task",
Expand All @@ -431,13 +432,18 @@ def task_instance_link(attr):
map_index=attr.get("map_index", -1),
)
url_root = url_for(
"Airflow.graph", dag_id=dag_id, root=task_id, execution_date=execution_date.isoformat()
"Airflow.grid",
dag_id=dag_id,
task_id=task_id,
dag_run_id=run_id,
tab="graph",
map_index=attr.get("map_index", -1),
)
return Markup(
"""
<span style="white-space: nowrap;">
<a href="{url}">{task_id}</a>
<a href="{url_root}" title="Filter on this task and upstream">
<a href="{url_root}" title="Filter on this task">
<span class="material-icons" style="margin-left:0;"
aria-hidden="true">filter_alt</span>
</a>
Expand Down

0 comments on commit 4922444

Please sign in to comment.