Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
Tracked by #10125
jtcohen6 opened this issue Nov 2, 2023 · 0 comments
Open
3 tasks done
Tracked by #10125
Labels
enhancement New feature or request multi_project

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Nov 2, 2023

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

@jtcohen6 jtcohen6 added enhancement New feature or request multi_project labels Nov 2, 2023
@github-actions github-actions bot changed the title [Feature] Support project as an alias for package selection method [CT-3314] [Feature] Support project as an alias for package selection method Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request multi_project
Projects
None yet
Development

No branches or pull requests

1 participant