Skip to content

Commit 1e713db

Browse files
wirchodbeatty10
andauthored
Avoid redundant node patch removal during partial parsing (#11887)
* Avoid redundant node patch removal during partial parsing * Changelog entry --------- Co-authored-by: Doug Beatty <[email protected]>
1 parent 6b7b1ad commit 1e713db

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Fixes
2+
body: Avoid redundant node patch removal during partial parsing
3+
time: 2025-08-04T07:40:06.993913-06:00
4+
custom:
5+
Author: wircho
6+
Issue: "11886"

core/dbt/parser/partial.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,10 @@ def delete_schema_mssa_links(self, schema_file, dict_key, elem) -> None:
870870
if node.is_versioned or elem.get("versions"):
871871
self.schedule_referencing_nodes_for_parsing(node.unique_id)
872872
# remove from patches
873-
schema_file.node_patches.remove(elem_unique_id)
873+
# For versioned models, the schedule_referencing_nodes_for_parsing call above
874+
# could have caused a recursive visit to this file.
875+
if elem_unique_id in schema_file.node_patches:
876+
schema_file.node_patches.remove(elem_unique_id)
874877

875878
# for models, seeds, snapshots (not analyses)
876879
if dict_key in ["models", "seeds", "snapshots"]:

0 commit comments

Comments
 (0)