Skip to content

Commit

Permalink
Assign selector before looping over nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
barton996 committed Dec 13, 2023
1 parent 20ff245 commit 8a83cd8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/dbt/graph/selector_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,12 @@ def search(self, included_nodes: Set[UniqueId], selector: str) -> Iterator[Uniqu
class PackageSelectorMethod(SelectorMethod):
def search(self, included_nodes: Set[UniqueId], selector: str) -> Iterator[UniqueId]:
"""Yields nodes from included that have the specified package"""
# `.` is an alias for the current dbt project name
if selector == "." and self.manifest.metadata.project_name is not None:
selector = self.manifest.metadata.project_name

for node, real_node in self.all_nodes(included_nodes):
if selector == "." and self.manifest.metadata.project_name is not None:
if fnmatch(real_node.package_name, self.manifest.metadata.project_name):
yield node
elif fnmatch(real_node.package_name, selector):
if fnmatch(real_node.package_name, selector):
yield node


Expand Down

0 comments on commit 8a83cd8

Please sign in to comment.