You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2022/06/01 07:43:41 UTC

[airflow] 11/12: Fix grid view for mapped tasks (#24059)

This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch v2-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit c9bba620986b7db6347c7d5d0264826709579f30
Author: Jed Cunningham <66...@users.noreply.github.com>
AuthorDate: Tue May 31 18:12:10 2022 -0600

    Fix grid view for mapped tasks (#24059)
    
    (cherry picked from commit 6e96f04eb515149f185448b8dfb84813c5879fc0)
---
 airflow/www/utils.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/airflow/www/utils.py b/airflow/www/utils.py
index 48512f03fa..8c05f37885 100644
--- a/airflow/www/utils.py
+++ b/airflow/www/utils.py
@@ -113,10 +113,11 @@ def get_mapped_summary(parent_instance, task_instances):
     )
 
     try_count = (
-        parent_instance.prev_attempted_tries
-        if parent_instance.prev_attempted_tries != 0
-        else parent_instance.try_number
+        parent_instance._try_number
+        if parent_instance._try_number != 0 or parent_instance.state in State.running
+        else parent_instance._try_number + 1
     )
+
     return {
         'task_id': parent_instance.task_id,
         'run_id': parent_instance.run_id,
@@ -130,6 +131,7 @@ def get_mapped_summary(parent_instance, task_instances):
 
 def get_task_summaries(task, dag_runs: List[DagRun], session: Session) -> List[Dict[str, Any]]:
     tis = session.query(
+        TaskInstance.dag_id,
         TaskInstance.task_id,
         TaskInstance.run_id,
         TaskInstance.map_index,