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


##########
airflow/www/views.py:
##########
@@ -250,19 +250,15 @@ def _safe_parse_datetime(v):
         abort(400, f"Invalid datetime: {v!r}")
 
 
-def task_group_to_grid(task_item_or_group, dag, dag_runs, tis, session):
+def task_group_to_grid(task_item_or_group, dag, dag_runs, session):
     """
     Create a nested dict representation of this TaskGroup and its children 
used to construct
     the Graph.
     """
     if isinstance(task_item_or_group, AbstractOperator):
         return {
             'id': task_item_or_group.task_id,
-            'instances': [
-                wwwutils.encode_ti(ti, task_item_or_group.is_mapped, session)
-                for ti in tis
-                if ti.task_id == task_item_or_group.task_id
-            ],
+            'instances': [wwwutils.encode_ti(dr, task_item_or_group, session) 
for dr in dag_runs],

Review Comment:
   Hmm it looks wrong to pass in a DagRun into `encode_ti`. The function’s 
typing annotation also says it taks a TaskInstance, not DagRun.



-- 
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