Skip to content

[CT-3314] [Feature] Support project as an alias for package selection method #8986

Open
@jtcohen6

Description

@jtcohen6

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

Let's support project as an alias for package when selecting nodes from a specific project.

https://docs.getdbt.com/reference/node-selection/methods#the-package-method
https://docs.getdbt.com/docs/collaborate/govern/project-dependencies

If you're in a dbt project that's taken a dependency on another dbt project:

  • via "package"-type dependency: this will select all nodes in the package
  • via "project"-type dependency: this will select only public models from the upstream project, imported as metadata only

Describe alternatives you've considered

Not doing this, sticking with the current language

Who will this benefit?

Less confusion for users of dbt Mesh. Why do I need to type dbt list -s package:upstream_project+, if I've intentionally chosen to depend on upstream_project as a "project" rather than a "package"?

Are you interested in contributing this feature?

sure!

Anything else?

class PackageSelectorMethod(SelectorMethod):
def search(self, included_nodes: Set[UniqueId], selector: str) -> Iterator[UniqueId]:
"""Yields nodes from included that have the specified package"""
for node, real_node in self.all_nodes(included_nodes):
if fnmatch(real_node.package_name, selector):
yield node

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood_first_issueStraightforward + self-contained changes, good for new contributors!multi_project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions