Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions recce/adapter/dbt_adapter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,15 @@ def execute(

def build_parent_map(self, nodes: Dict, base: Optional[bool] = False) -> Dict[str, List[str]]:
manifest = self.curr_manifest if base is False else self.base_manifest
manifest_dict = manifest.to_dict()

try:
parent_map_source = manifest.parent_map
except AttributeError:
parent_map_source = manifest.to_dict()["parent_map"]

node_ids = nodes.keys()
node_ids = set(nodes)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The keys view is set-like, so I think we don't need to change it to set to improve the lookup time.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair. making the edit

Copy link
Collaborator

@wcchang1115 wcchang1115 Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I mean we can keep the original node_ids = nodes.keys()

parent_map = {}
for k, parents in manifest_dict["parent_map"].items():
for k, parents in parent_map_source.items():
if k not in node_ids:
continue
parent_map[k] = [parent for parent in parents if parent in node_ids]
Expand Down
Loading