You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resolving references to an upstream public model (which dbt-core understands as an "external" node)
with deferral enabled
and I don't have metadata permissions on the schema containing that upstream public model (unusual, but it does happen)
Then I'll get a failure like (BigQuery):
403 GET https://bigquery.googleapis.com/bigquery/v2/projects/...: Access Denied: Table ...: Permission bigquery.tables.get denied on table ... (or it may not exist).
Expected Behavior
Because enabling deferral (--defer) won't actually change which reference dbt will use for upstream public models (external nodes), regardless of whether the object exists or not, there's no reason to attempt a cache lookup for it in RuntimeRefResolver.create_relation.
dbt already excludes external nodes from initial cache population here.
Steps To Reproduce
Define a model with a reference to an upstream public model in another project, in a schema that you do not have permission to access.
dbt compile that model - succeeds. (Note that it will still fail at runtime.)
Try compiling again with deferral enabled (dbt compile --defer) - fails, because dbt attempts a cache lookup that isn't strictly necessarily.
Relevant log output
No response
Environment
- dbt: latest
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
I'm not sure if this is valuable input, but from the way we experience it:
If I am (in dbt-cloud):
build a dbt-model that references an upstream public model
and I have metadata permissions on the schema containing that upstream public model
but the public model itself has upstream references to a database I do not have access to
and the dbt-job is specified with Generate docs on run turned on.
Then dbt build works, but I'll get a failure if:
the public model is referenced by a dbt-model that runs in a different database that I do not have access to (which is by design) with the error ['database that the public model is not in' does not exist or not authorized].
Is this a new bug in dbt-core?
Current Behavior
Full context in internal slack thread
If I am:
Then I'll get a failure like (BigQuery):
Expected Behavior
Because enabling deferral (
--defer
) won't actually change which reference dbt will use for upstream public models (external nodes), regardless of whether the object exists or not, there's no reason to attempt a cache lookup for it in RuntimeRefResolver.create_relation.dbt already excludes external nodes from initial cache population here.
Steps To Reproduce
dbt compile
that model - succeeds. (Note that it will still fail at runtime.)dbt compile --defer
) - fails, because dbt attempts a cache lookup that isn't strictly necessarily.Relevant log output
No response
Environment
- dbt: latest
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: