Fix blank Assets dependency graph from missing Dag nodes#69171
Merged
pierrejeambrun merged 1 commit intoJul 2, 2026
Conversation
2cd09ef to
183e446
Compare
SameerMesiah97
left a comment
Contributor
There was a problem hiding this comment.
It seems like this fix is just papering over a gap in the existing algorithm. It might be that is the only reasonable solution so you are free to push back.
pierrejeambrun
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The scheduling dependencies endpoint is currently able to return an edge with a
dag:endpoint that is never materialised as a node. This appears to be causing problems for the ELK renderer when creating the dependency graph in the Assets UI.This PR adds a loop to backfill any
dag:nodes that are referenced by an edge but are missing from the nodes set.Why
The scheduling view of the Assets dependency graph fails to render whenever it contains a Dag referenced by another Dag (e.g. via
TriggerDagRunOperatororExternalTaskSensor) and has no scheduling dependencies of its own.The
get_scheduling_dependenciesfunction iterates over each Dag's dependencies to build a list of nodes and edges. A Dag is only materialised as adag:node if it has at least one dependency of its own, but it is possible for the same Dag to be an endpoint of an edge if it is referenced by another Dag. This leaves a dangling edge whose endpoint is missing from the node set.Reproduction
Parent Dag
Child Dag
Before
Scheduling view
/ui/dependencies?dependency_type=schedulingResponse{ "edges": [ { "source_id": "dag:parent_dag", "target_id": "asset:1" }, { "source_id": "dag:parent_dag", "target_id": "trigger:parent_dag:child_dag:trigger_child_dag" }, { "source_id": "trigger:parent_dag:child_dag:trigger_child_dag", "target_id": "dag:child_dag" } ], "nodes": [ { "id": "dag:parent_dag", "label": "parent_dag", "type": "dag", "team": null }, { "id": "asset:1", "label": "parent_dag_asset", "type": "asset", "team": null }, { "id": "trigger:parent_dag:child_dag:trigger_child_dag", "label": "trigger_child_dag", "type": "trigger", "team": null } ] }After
Scheduling view

/ui/dependencies?dependency_type=schedulingResponse{ "edges": [ { "source_id": "dag:parent_dag", "target_id": "asset:1" }, { "source_id": "dag:parent_dag", "target_id": "trigger:parent_dag:child_dag:trigger_child_dag" }, { "source_id": "trigger:parent_dag:child_dag:trigger_child_dag", "target_id": "dag:child_dag" } ], "nodes": [ { "id": "dag:parent_dag", "label": "parent_dag", "type": "dag", "team": null }, { "id": "asset:1", "label": "parent_dag_asset", "type": "asset", "team": null }, { "id": "trigger:parent_dag:child_dag:trigger_child_dag", "label": "trigger_child_dag", "type": "trigger", "team": null }, { "id": "dag:child_dag", "label": "child_dag", "type": "dag", "team": null } ] }Note node set now correctly includes id:
dag:child_dag, so edge below is no longer dangling:{ "source_id": "trigger:parent_dag:child_dag:trigger_child_dag", "target_id": "dag:child_dag" }Was generative AI tooling used to co-author this PR?
Generated-by: Claude Sonnet 4.6 following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.