You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by da...@apache.org on 2017/02/27 21:43:45 UTC

incubator-airflow git commit: [AIRFLOW-919] Running tasks with no start date shouldn't break a DAGs UI

Repository: incubator-airflow
Updated Branches:
  refs/heads/master 5831652f3 -> 57e8956b5


[AIRFLOW-919] Running tasks with no start date shouldn't break a DAGs UI

Please accept this PR that addresses the following
issues:
-
https://issues.apache.org/jira/browse/AIRFLOW-919

I also made the airflow PR template a little bit
less verbose (requires less edits when creating a
PR).

Testing Done:
- Ran a webserver with this case and made sure
that the DAG page loaded

Closes #2110 from
aoen/ddavydov/fix_running_task_with_no_start_date


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

Branch: refs/heads/master
Commit: 57e8956b5635211a34744943e071330f098d4639
Parents: 5831652
Author: Dan Davydov <da...@airbnb.com>
Authored: Mon Feb 27 13:43:25 2017 -0800
Committer: Dan Davydov <da...@airbnb.com>
Committed: Mon Feb 27 13:43:29 2017 -0800

----------------------------------------------------------------------
 .github/PULL_REQUEST_TEMPLATE.md | 6 +-----
 airflow/www/views.py             | 3 ++-
 2 files changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/57e8956b/.github/PULL_REQUEST_TEMPLATE.md
----------------------------------------------------------------------
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 5681a89..b92e29a 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,9 +1,5 @@
-Dear Airflow Maintainers,
-
 Please accept this PR that addresses the following issues:
-- *(replace with a link to AIRFLOW-X)*
-
-Per Apache guidelines you need to create a [Jira issue](https://issues.apache.org/jira/browse/AIRFLOW/).
+- *(MANDATORY - replace with a link to JIRA - e.g. https://issues.apache.org/jira/browse/AIRFLOW-XXX)*
 
 Testing Done:
 - Unittests are required, if you do not include new unit tests please

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/57e8956b/airflow/www/views.py
----------------------------------------------------------------------
diff --git a/airflow/www/views.py b/airflow/www/views.py
index 0b1db61..e064f38 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -1220,7 +1220,8 @@ class Airflow(BaseView):
                 children_key = "_children"
 
             def set_duration(tid):
-                if isinstance(tid, dict) and tid.get("state") == State.RUNNING:
+                if (isinstance(tid, dict) and tid.get("state") == State.RUNNING and
+                        tid["start_date"] is not None):
                     d = datetime.now() - dateutil.parser.parse(tid["start_date"])
                     tid["duration"] = d.total_seconds()
                 return tid