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


##########
airflow/www/views.py:
##########
@@ -596,21 +596,17 @@ def collect_edges(task_group):
     # Collect all the edges between individual tasks
     edges = set()
 
-    def get_downstream(task):
-        tasks_to_trace = {(task, frozenset(task.downstream_list))}
-        while tasks_to_trace:
-            tasks_to_trace_next: Set[tuple] = set()
-            for task, children in tasks_to_trace:
-                for child in children:
-                    edge = (task.task_id, child.task_id)
-                    if edge in edges:
-                        continue
-                    edges.add(edge)
-                    tasks_to_trace_next.add((child, 
frozenset(child.downstream_list)))
-            tasks_to_trace = tasks_to_trace_next
-
-    for root in dag.roots:
-        get_downstream(root)
+    tasks_to_trace: List[Operator] = dag.roots
+    while tasks_to_trace:
+        tasks_to_trace_next: List[Operator] = []
+        for task in tasks_to_trace:
+            for child in task.downstream_list:
+                edge = (task.task_id, child.task_id)

Review Comment:
   Use `node_id` here to avoid task and child needing to be an Operator.



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