Skip to content

Commit

Permalink
[AIRFLOW-777] Fix expression to check if a DagRun is in running state
Browse files Browse the repository at this point in the history
  • Loading branch information
gsakkis committed Jan 22, 2017
1 parent 1a801cc commit 2d2d627
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions airflow/jobs.py
Expand Up @@ -919,13 +919,7 @@ def _change_state_for_tis_without_dagrun(self,
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,
Expand Down

0 comments on commit 2d2d627

Please sign in to comment.