bbovenzi commented on code in PR #44701:
URL: https://github.com/apache/airflow/pull/44701#discussion_r1880690283
##########
airflow/api_fastapi/core_api/routes/ui/structure.py:
##########
@@ -63,4 +63,36 @@ def structure_data(
"edges": edges,
}
+ if external_dependencies:
+ entry_node_ref = nodes[0] if nodes else None
+ exit_node_ref = nodes[-1] if nodes else None
Review Comment:
Nodes are already topologically sorted, right?
##########
airflow/api_fastapi/core_api/routes/ui/structure.py:
##########
@@ -63,4 +63,36 @@ def structure_data(
"edges": edges,
}
+ if external_dependencies:
+ entry_node_ref = nodes[0] if nodes else None
+ exit_node_ref = nodes[-1] if nodes else None
+
+ start_edges: list[dict] = []
+ end_edges: list[dict] = []
+
+ for dependency_dag_id, dependencies in
SerializedDagModel.get_dag_dependencies().items():
+ for dependency in dependencies:
+ if dependency_dag_id != dag_id and dependency.target != dag_id:
+ continue
+
+ # Add nodes
+ nodes.append(
+ {
+ "id": dependency.node_id,
+ "label": dependency.node_id,
Review Comment:
the node_id is a bad label. There was also `dependency.dependency_id` is
that more helpful?
--
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]