Repository: incubator-airflow
Updated Branches:
  refs/heads/master 149195845 -> d76bf76de


[AIRFLOW-1229] Add link to Run Id, incl execution_date

Add two UI improvement. 1: the links from "DAG
runs" to DAG graph view
include the execution_date. So you land on the
expected DAG, instead of
the last DAG run. 2: A new link is added for the
column "Run Id" with the
same behaviour.

Closes #2801 from abij/AIRFLOW-1229


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/d76bf76d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/d76bf76d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/d76bf76d

Branch: refs/heads/master
Commit: d76bf76de2d2d4d3041e4d1bf9304dce8a1bcefb
Parents: 1491958
Author: Alexander Bij <alexander...@godatadriven.com>
Authored: Thu Nov 23 10:46:21 2017 +0100
Committer: Fokko Driesprong <fokkodriespr...@godatadriven.com>
Committed: Thu Nov 23 10:46:21 2017 +0100

----------------------------------------------------------------------
 airflow/www/views.py | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/d76bf76d/airflow/www/views.py
----------------------------------------------------------------------
diff --git a/airflow/www/views.py b/airflow/www/views.py
index c7869c5..1191bde 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -103,7 +103,8 @@ def dag_link(v, c, m, p):
     dag_id = bleach.clean(m.dag_id)
     url = url_for(
         'airflow.graph',
-        dag_id=dag_id)
+        dag_id=dag_id,
+        execution_date=m.execution_date)
     return Markup(
         '<a href="{}">{}</a>'.format(url, dag_id))
 
@@ -115,6 +116,16 @@ def log_url_formatter(v, c, m, p):
         '</span></a>').format(**locals())
 
 
+def dag_run_link(v, c, m, p):
+    dag_id = bleach.clean(m.dag_id)
+    url = url_for(
+        'airflow.graph',
+        dag_id=m.dag_id,
+        run_id=m.run_id,
+        execution_date=m.execution_date)
+    return Markup('<a href="{url}">{m.run_id}</a>'.format(**locals()))
+
+
 def task_instance_link(v, c, m, p):
     dag_id = bleach.clean(m.dag_id)
     task_id = bleach.clean(m.task_id)
@@ -2380,7 +2391,9 @@ class DagRunModelView(ModelViewOnly):
         execution_date=datetime_f,
         state=state_f,
         start_date=datetime_f,
-        dag_id=dag_link)
+        dag_id=dag_link,
+        run_id=dag_run_link
+    )
 
     @action('new_delete', "Delete", "Are you sure you want to delete selected 
records?")
     @provide_session
@@ -2459,7 +2472,9 @@ class TaskInstanceModelView(ModelViewOnly):
         start_date=datetime_f,
         end_date=datetime_f,
         queued_dttm=datetime_f,
-        dag_id=dag_link, duration=duration_f)
+        dag_id=dag_link,
+        run_id=dag_run_link,
+        duration=duration_f)
     column_searchable_list = ('dag_id', 'task_id', 'state')
     column_default_sort = ('job_id', True)
     form_choices = {

Reply via email to