You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bo...@apache.org on 2017/01/22 16:36:18 UTC

[4/5] incubator-airflow git commit: [AIRFLOW-777] Fix expression to check if a DagRun is in running state

[AIRFLOW-777] Fix expression to check if a DagRun is in running state


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

Branch: refs/heads/master
Commit: 2d2d6270ad6bf6052c3efe90100740d3470c0cd1
Parents: 1a801cc
Author: George Sakkis <ge...@gmail.com>
Authored: Sat Jan 21 15:06:43 2017 +0200
Committer: George Sakkis <ge...@gmail.com>
Committed: Sun Jan 22 14:55:48 2017 +0200

----------------------------------------------------------------------
 airflow/jobs.py | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/2d2d6270/airflow/jobs.py
----------------------------------------------------------------------
diff --git a/airflow/jobs.py b/airflow/jobs.py
index f1de333..8bb93bb 100644
--- a/airflow/jobs.py
+++ b/airflow/jobs.py
@@ -919,13 +919,7 @@ class SchedulerJob(BaseJob):
                                          task_instance.execution_date,
                                          dag_runs))
 
-            dag_is_running = True
-            for dag_run in dag_runs:
-                if dag_run.state == State.RUNNING:
-                    dag_is_running = True
-                    break
-
-            if not dag_is_running:
+            if not any(dag_run.state == State.RUNNING for dag_run in dag_runs):
                 self.logger.warn("Setting {} to state={} as it does not have "
                                  "a DagRun in the {} state"
                                  .format(task_instance,