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

Enable authorization of materialized views #788

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

kubikb
Copy link

@kubikb kubikb commented Feb 5, 2025

resolves #773.

Problem

Similarly to BigQuery views, BigQuery materialized views can also be authorized to access the data in another dataset(s). However, providing the grant_access_to configuration to a model with materialized_view materialization goes silently ignored and the materialized view does NOT get authorized to access data in another dataset. With models with view materialization, the grant_access_to configuration leads to the desired behavior, namely the view gets authorized to access data in another dataset.

Solution

This pull request add logic to handle the config grant_access_to also for models with materialization materialized_view. The PR also extends currently existing tests.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

Moved from dbt-labs/dbt-bigquery#1470

@kubikb kubikb requested a review from a team as a code owner February 5, 2025 16:51
@cla-bot cla-bot bot added the cla:yes The PR author has signed the CLA label Feb 5, 2025
@kubikb
Copy link
Author

kubikb commented Feb 7, 2025

An unrelated integration test fails. My changes didn't alter the behavior tested by the integration test tests/functional/adapter/test_basic.py::TestDocsGenerateBigQuery::test_run_and_generate_no_compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes The PR author has signed the CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Materialized views cannot be authorized
1 participant