I’m running dbt with some selected models by tag. However this fails with a TrinoError saying I don’t have access to certain catalogs not used by the models I’m trying to run.
It looks like dbt trying to access the gold catalog when I’m only running bronze models that have no refs to gold? Does dbt validate/check access to all configured catalogs during parsing or compilation, even for models outside the selection?
For reference, we have a setup similar to this:
snapshots:
my_project:
+database: "{{ 'sandbox' if 'local_dev' in target.name else 'silver' }}"
models:
my_project:
bronze:
+database: “{{ ‘sandbox’ if ‘local_dev’ in target.name else ‘bronze’ }}”
silver:
+database: “{{ ‘sandbox’ if ‘local_dev’ in target.name else ‘silver’ }}”
gold:
+database: “{{ ‘sandbox’ if ‘local_dev’ in target.name else ‘gold’ }}”
Here is what I’ve tried:
`dbt run -s tag:my_tag` which results in
TrinoUserError(type=USER_ERROR, name=PERMISSION_DENIED, message="Access Denied: Cannot access catalog silver", query_id=...)
I then tried excluding the snapshot
`dbt run -s tag:my_tag ––exclude resource_type:snapshot` but then I got
TrinoUserError(type=USER_ERROR, name=PERMISSION_DENIED, message="Access Denied: Cannot access catalog gold", query_id=...)