airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msu...@apache.org
Subject incubator-airflow git commit: [AIRFLOW-619] Fix exception in Gannt chart
Date Fri, 11 Nov 2016 04:38:51 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/master f19277003 -> 868bc8313


[AIRFLOW-619] Fix exception in Gannt chart

If a TaskInstance has no end_date, use
datetime.now()

Closes #1874 from dgies/master


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

Branch: refs/heads/master
Commit: 868bc83137adca0ebfd5780f0dff5a7bfdfaadf9
Parents: f192770
Author: Daniel Gies <dgies@pandora.com>
Authored: Fri Nov 11 10:08:27 2016 +0530
Committer: Sumit Maheshwari <sumeet.manit@gmail.com>
Committed: Fri Nov 11 10:08:27 2016 +0530

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


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/868bc831/airflow/www/views.py
----------------------------------------------------------------------
diff --git a/airflow/www/views.py b/airflow/www/views.py
index 9226ce0..618c8c8 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -1694,13 +1694,14 @@ class Airflow(BaseView):
 
         tasks = []
         for ti in tis:
+            end_date = ti.end_date if ti.end_date else datetime.now()
             tasks.append({
                 'startDate': wwwutils.epoch(ti.start_date),
-                'endDate': wwwutils.epoch(ti.end_date or datetime.now()),
+                'endDate': wwwutils.epoch(end_date),
                 'isoStart': ti.start_date.isoformat()[:-4],
-                'isoEnd': ti.end_date.isoformat()[:-4],
+                'isoEnd': end_date.isoformat()[:-4],
                 'taskName': ti.task_id,
-                'duration': "{}".format(ti.end_date - ti.start_date)[:-4],
+                'duration': "{}".format(end_date - ti.start_date)[:-4],
                 'status': ti.state,
                 'executionDate': ti.execution_date.isoformat(),
             })


Mime
View raw message