Generates a URL to the Graph View for a TaskInstance.
(attr)
| 203 | |
| 204 | |
| 205 | def task_instance_link(attr): |
| 206 | """Generates a URL to the Graph View for a TaskInstance.""" |
| 207 | dag_id = attr.get('dag_id') |
| 208 | task_id = attr.get('task_id') |
| 209 | execution_date = attr.get('execution_date') |
| 210 | url = url_for('Airflow.task', dag_id=dag_id, task_id=task_id, execution_date=execution_date.isoformat()) |
| 211 | url_root = url_for( |
| 212 | 'Airflow.graph', dag_id=dag_id, root=task_id, execution_date=execution_date.isoformat() |
| 213 | ) |
| 214 | return Markup( # noqa |
| 215 | """ |
| 216 | <span style="white-space: nowrap;"> |
| 217 | <a href="{url}">{task_id}</a> |
| 218 | <a href="{url_root}" title="Filter on this task and upstream"> |
| 219 | <span class="material-icons" style="margin-left:0;" |
| 220 | aria-hidden="true">filter_alt</span> |
| 221 | </a> |
| 222 | </span> |
| 223 | """ |
| 224 | ).format(url=url, task_id=task_id, url_root=url_root) |
| 225 | |
| 226 | |
| 227 | def state_token(state): |