[Feature] support `grant_access_to` for materialized views
Is this a new bug in dbt-bigquery?
- [X] I believe this is a new bug in dbt-bigquery
- [X] I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
We currently grant access to views with this config:
salesforce:
+grant_access_to:
- project: data-lake
dataset: salesforce
Which works well for views. Now we're transitioning to using materialized views, which doesn't seem to trigger the authorization.
Expected Behavior
I expect views and materialized views to work the same, in the UI there's no discernible difference when granting access, the API seems to be the same.
Steps To Reproduce
- Create a source dataset with a table
- Create a target model in another dataset, materialized as a materialized view
- In the target model, add config to grant access to the source dataset.
- Run the models
- Check if materialized view is listed under authorized views on the source dataset
Relevant log output
No response
Environment
- OS: Debian 12
- Python: Python 3.9.18
- dbt-core: 1.7.6
- dbt-bigquery: 1.7.6
Additional Context
No response
Materialized views don't currently support grant_access_to, though that would definitely be useful. I'm going to update this to a feature request so that it can be prioritized against the feature backlog.
so this chunk of code in dbt-bigquery's view materialization will need to somehow make it into the "materialized_view" materialization.
https://github.com/dbt-labs/dbt-bigquery/blob/955afbd74b19d37f6c7919a4a92dd2cc50eae905/dbt/include/bigquery/macros/materializations/view.sql#L21-L25
so this chunk of code in dbt-bigquery's view materialization will need to somehow make it into the "materialized_view" materialization.
https://github.com/dbt-labs/dbt-bigquery/blob/955afbd74b19d37f6c7919a4a92dd2cc50eae905/dbt/include/bigquery/macros/materializations/view.sql#L21-L25
Presumably? I'd need to look more into it. And then we would want a test or two for it as well, and we'd need to update the docs.