Optimize grid node merging with ID index#61656
Merged
pierrejeambrun merged 1 commit intoapache:mainfrom Feb 11, 2026
Merged
Conversation
github-actions bot
pushed a commit
that referenced
this pull request
Feb 11, 2026
(cherry picked from commit 9da4a15) Co-authored-by: Steve Ahn <steveahnahn@g.ucla.edu>
jason810496
pushed a commit
that referenced
this pull request
Feb 12, 2026
(cherry picked from commit 9da4a15) Co-authored-by: Steve Ahn <steveahnahn@g.ucla.edu>
pierrejeambrun
pushed a commit
that referenced
this pull request
Feb 12, 2026
Ratasa143
pushed a commit
to Ratasa143/airflow
that referenced
this pull request
Feb 15, 2026
This was referenced Feb 16, 2026
Closed
choo121600
pushed a commit
to choo121600/airflow
that referenced
this pull request
Feb 22, 2026
Subham-KRLX
pushed a commit
to Subham-KRLX/airflow
that referenced
this pull request
Mar 4, 2026
vatsrahul1001
pushed a commit
that referenced
this pull request
Mar 4, 2026
dominikhei
pushed a commit
to dominikhei/airflow
that referenced
this pull request
Mar 11, 2026
Ankurdeewan
pushed a commit
to Ankurdeewan/airflow
that referenced
this pull request
Mar 15, 2026
radhwene
pushed a commit
to radhwene/airflow
that referenced
this pull request
Mar 21, 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.
Summary
Optimize grid node merge by replacing repeated list scans with a single ID -> node index, improving merge performance when combining node trees.
The previous _merge_node_dicts used a set for ID membership (O(1)), but still performed a full list scan to retrieve the node object on every match. That turned the merge into O(n·m) for large grids and repeated work for each incoming node.
This change makes lookups O(1) and scales better with newly appended nodes being updated the dict so subsequent lookups see it.
Tests
test_merge_node_dicts_merges_children_and_appends_new_nodes
test_merge_node_dicts_preserves_existing_non_group_node_shape
test_merge_node_dicts_large_merge_keeps_unique_nodes
These cover correct child merges, avoiding accidental mutation of leaf nodes, and ensuring large merges don’t duplicate entries.