diff --git a/airflow/www/templates/airflow/dags.html b/airflow/www/templates/airflow/dags.html index 14f8b7ef60f40..a480869251ff5 100644 --- a/airflow/www/templates/airflow/dags.html +++ b/airflow/www/templates/airflow/dags.html @@ -370,14 +370,15 @@

DAGs

function lastDagRunsHandler(error, json) { for(var safe_dag_id in json) { dag_id = json[safe_dag_id].dag_id; - last_run = json[safe_dag_id].last_run; + execution_date = json[safe_dag_id].execution_date; + start_date = json[safe_dag_id].start_date; g = d3.select('div#last-run-' + safe_dag_id) g.selectAll('a') - .attr('href', '{{ url_for('Airflow.graph') }}?dag_id=' + encodeURIComponent(dag_id) + '&execution_date=' + encodeURIComponent(last_run)) - .insert(isoDateToTimeEl.bind(null, last_run, {title: false})); + .attr('href', '{{ url_for('Airflow.graph') }}?dag_id=' + encodeURIComponent(dag_id) + '&execution_date=' + encodeURIComponent(execution_date)) + .insert(isoDateToTimeEl.bind(null, execution_date, {title: false})); g.selectAll('span') // We don't translate the timezone in the tooltip, that stays in UTC. - .attr('data-original-title', 'Start Date: ' + last_run) + .attr('data-original-title', 'Start Date: ' + start_date) .style('display', null); g.selectAll('.loading-last-run').remove(); } diff --git a/airflow/www/views.py b/airflow/www/views.py index 354672f32753f..ce7ca7e5fad8c 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -726,7 +726,9 @@ def last_dagruns(self, session=None): return wwwutils.json_response({}) query = session.query( - DagRun.dag_id, sqla.func.max(DagRun.execution_date).label('last_run') + DagRun.dag_id, + sqla.func.max(DagRun.execution_date).label('execution_date'), + sqla.func.max(DagRun.start_date).label('start_date'), ).group_by(DagRun.dag_id) # Filter to only ask for accessible and selected dags @@ -735,7 +737,8 @@ def last_dagruns(self, session=None): resp = { r.dag_id.replace('.', '__dot__'): { 'dag_id': r.dag_id, - 'last_run': r.last_run.isoformat(), + 'execution_date': r.execution_date.isoformat(), + 'start_date': r.start_date.isoformat(), } for r in query } return wwwutils.json_response(resp)