-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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-2889] Macros executed via run-operation cannot ref private
models
#8248
Comments
private
modelsprivate
models
@nicholasyager Thanks for opening! :) It does feel a bit weird that macros can reference private models, if called from within other models in the same group, but not if the same macro is called via I'm inclined to say that we should support this, same as how we added support for compilation/preview of I'll queue this up for the next milestone of multi-project work. If the fix is quite simple (and I think it is, right where you're pointing to!) we could backport for inclusion in a v1.6.x patch. |
Notes from refinement:
|
Hi team. Any update on when this might be updated/fixed? The label says backport 1.7 but 1.8 is out now. |
@b-per I've just created a new epic for multi-project work over the next few months, and I'm including this on there. I see this lower priority than other bugs / QoL improvements that have been coming up more often, but definitely open to hearing that I should be prioritizing it more highly. At this point, I'd be inclined to "roll forward" with this fix, and include it in the subsequent minor version. I don't think this would be a very big lift, so I'd say it's also fair game for community contribution (by you or someone else) :) |
Yes, my comment about seeing the backport 1.7 label was more whether it was still an issue considered for the future. Should we add the community label then? And I'll check the new epic! 👀 |
private
modelsprivate
models
Is this a new bug in dbt-core?
Current Behavior
Suppose you have a model (
order.sql
) setup in a group (example
) with access set to private. If you execute a macro thatref
s this private model, dbt will abort with anAttributeError: 'Macro' object has no attribute 'group'
exception.This issue seems to originate in the
resolve
method inRuntimeRefResolver
. Specifically, this chunk of logic:When running a macro via run-operation,
target_model
is not aParsedNode
, but rather aMacro
, which do not have a concept of agroup
. Hence, theAttributeError
.Expected Behavior
Given that macros are not part of the group and access abstraction, I would expect macros executed within a
run-operation
context to be able to ref any model in a dbt project without verifying group membership.Steps To Reproduce
run-operation
.Relevant log output
See above in current behavior
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: