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

pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 414407b7d72 Fix structure edges (#51484)
414407b7d72 is described below

commit 414407b7d72f85e43ad67352c4da5090d8e24a56
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Fri Jun 6 20:06:21 2025 +0200

    Fix structure edges (#51484)
---
 .../api_fastapi/core_api/routes/ui/structure.py    |  4 ++--
 .../core_api/routes/ui/test_structure.py           | 28 +++++++++++-----------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git 
a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/structure.py 
b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/structure.py
index 25c8134203b..a84f36ab010 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/structure.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/structure.py
@@ -138,9 +138,9 @@ def structure_data(
                 asset_expression, entry_node_ref["id"]
             )
             data["nodes"] += upstream_asset_nodes
-            data["edges"] = upstream_asset_edges
+            data["edges"] += upstream_asset_edges
 
-        data["edges"] += start_edges + edges + end_edges
+        data["edges"] += start_edges + end_edges
 
     bind_output_assets_to_tasks(data["edges"], serialized_dag)
 
diff --git 
a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_structure.py 
b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_structure.py
index 035721a1dcb..2c6425db1b3 100644
--- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_structure.py
+++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_structure.py
@@ -310,6 +310,20 @@ class TestStructureDataEndpoint:
         }
         expected = {
             "edges": [
+                {
+                    "is_setup_teardown": None,
+                    "label": None,
+                    "source_id": "external_task_sensor",
+                    "target_id": "task_2",
+                    "is_source_asset": None,
+                },
+                {
+                    "is_setup_teardown": None,
+                    "label": None,
+                    "source_id": "task_1",
+                    "target_id": "external_task_sensor",
+                    "is_source_asset": None,
+                },
                 {
                     "is_setup_teardown": None,
                     "label": None,
@@ -352,20 +366,6 @@ class TestStructureDataEndpoint:
                     "target_id": "task_1",
                     "is_source_asset": None,
                 },
-                {
-                    "is_setup_teardown": None,
-                    "label": None,
-                    "source_id": "external_task_sensor",
-                    "target_id": "task_2",
-                    "is_source_asset": None,
-                },
-                {
-                    "is_setup_teardown": None,
-                    "label": None,
-                    "source_id": "task_1",
-                    "target_id": "external_task_sensor",
-                    "is_source_asset": None,
-                },
                 {
                     "is_setup_teardown": None,
                     "label": None,

Reply via email to