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-1993] Raise an exception from ref if referencing a private model across groups #6826

Closed
Tracked by #6747
MichelleArk opened this issue Feb 1, 2023 · 3 comments · Fixed by #7069
Closed
Tracked by #6747
Assignees
Labels
model_groups_access Issues related to groups multi_project user docs [docs.getdbt.com] Needs better documentation

Comments

@MichelleArk
Copy link
Contributor

MichelleArk commented Feb 1, 2023

During resolution, raise an exception if a node attempts to ref a private model from a different group than the referenced private model’s group.

Nodes not in a group (group is None) should not be able to reference any private models because they are not part of any group.

Note: exposures can have ref calls, but are not 'groupable'. Following on the logic above, they should not be able to reference any private models because they are not part of any group.

@github-actions github-actions bot changed the title Raise an exception from ref if referencing a private model across groups [CT-1993] Raise an exception from ref if referencing a private model across groups Feb 1, 2023
@MichelleArk MichelleArk changed the title [CT-1993] Raise an exception from ref if referencing a private model across groups [CT-1993] Raise a compilation error from ref if referencing a private model across groups Feb 1, 2023
@jtcohen6
Copy link
Contributor

jtcohen6 commented Feb 1, 2023

Discussed live: We may want a new class of exception, DependencyError, when:

  • ref/source/metric a model/source/metric/etc that doesn't exist
  • a model wants to belong to a group that doesn't exist
  • ref a model in a different group with access: private

(as distinct from existing CompilationError)

@MichelleArk MichelleArk changed the title [CT-1993] Raise a compilation error from ref if referencing a private model across groups [CT-1993] Raise an exception from ref if referencing a private model across groups Feb 1, 2023
@MichelleArk
Copy link
Contributor Author

From 2/6 Estimation - ReferenceError would be a preferable name to DependencyError

@jtcohen6
Copy link
Contributor

jtcohen6 commented Feb 9, 2023

As @emmyoop rightly knew (or guessed), we already have an exception named DependencyError, and it's only used within dbt deps.

ReferenceError all the way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
model_groups_access Issues related to groups multi_project user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants