uranusjr commented on code in PR #32011:
URL: https://github.com/apache/airflow/pull/32011#discussion_r1234978334


##########
airflow/www/views.py:
##########
@@ -1419,7 +1419,11 @@ def rendered_templates(self, session):
             ti.dag_run = DagRun(dag_id=dag_id, execution_date=dttm)
         else:
             ti = dag_run.get_task_instance(task_id=task_id, 
map_index=map_index, session=session)
-            ti.refresh_from_task(raw_task)
+            if ti:
+                ti.refresh_from_task(raw_task)
+            else:
+                # When there is no task instance with the given map_index
+                ti = TaskInstance(raw_task, map_index=map_index)

Review Comment:
   I would prefer this to just raise directly. It is very awkward to 
instantiate a task instance just to fail later.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to