Skip to content

Commit

Permalink
[AIRFLOW-7113] Fix gantt render error (apache#7913)
Browse files Browse the repository at this point in the history
Co-authored-by: Cong Zhu <[email protected]>
  • Loading branch information
2 people authored and kaxil committed Mar 28, 2020
1 parent b7d650b commit d97711a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2083,12 +2083,13 @@ def gantt(self, session=None):
prev_task_id = ""
for tf in ti_fails:
end_date = tf.end_date or timezone.utcnow()
start_date = tf.start_date or end_date
if tf_count != 0 and tf.task_id == prev_task_id:
try_count = try_count + 1
else:
try_count = 1
prev_task_id = tf.task_id
gantt_bar_items.append((tf.task_id, tf.start_date, end_date, State.FAILED, try_count))
gantt_bar_items.append((tf.task_id, start_date, end_date, State.FAILED, try_count))
tf_count = tf_count + 1

tasks = []
Expand Down
3 changes: 2 additions & 1 deletion airflow/www_rbac/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1918,12 +1918,13 @@ def gantt(self, session=None):
prev_task_id = ""
for tf in ti_fails:
end_date = tf.end_date or timezone.utcnow()
start_date = tf.start_date or end_date
if tf_count != 0 and tf.task_id == prev_task_id:
try_count = try_count + 1
else:
try_count = 1
prev_task_id = tf.task_id
gantt_bar_items.append((tf.task_id, tf.start_date, end_date, State.FAILED, try_count))
gantt_bar_items.append((tf.task_id, start_date, end_date, State.FAILED, try_count))
tf_count = tf_count + 1

task_types = {}
Expand Down

0 comments on commit d97711a

Please sign in to comment.