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 #1470

Closed
wants to merge 6 commits into from
Closed

Conversation

kubikb
Copy link

@kubikb kubikb commented Feb 2, 2025

resolves dbt-labs/dbt-adapters#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

@kubikb kubikb requested a review from a team as a code owner February 2, 2025 09:54
@cla-bot cla-bot bot added the cla:yes label Feb 2, 2025
@kubikb kubikb changed the title Add test to grant access to materialized view, extend table materiali… Enable authorization of materialized views Feb 3, 2025
@kubikb
Copy link
Author

kubikb commented Feb 5, 2025

@amychen1776 I saw that the issue dbt-labs/dbt-adapters#773 has been moved from dbt-bigquery to dbt-adapters. Thanks for that! Should this PR fixing the issue also move there? Also, when could you or somebody from your side review this PR?

@amychen1776
Copy link

Hello @kubikb ! That's correct - here's more information about why the change dbt-labs/dbt-adapters#378

You should definitely migrate the PR over and we will land this in our triage backlog. Thank you for the work!

@kubikb
Copy link
Author

kubikb commented Feb 5, 2025

Thanks @amychen1776 , I opened this PR in the dbt-adapters repo: dbt-labs/dbt-adapters#788

@kubikb kubikb closed this Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Materialized views cannot be authorized
2 participants