dbt-labs / dbt-labs/dbt-adapters

[Feature] Support overriding `grant_access_to`

Open
#556 1 comment 4 reactions 0 assignees View on GitHub
pkg:dbt-bigquery type:enhancement
Dominant language
Python
Stars
233
Forks
362
Avg merge
3d 22h
Merged PRs (30d)
9

Description

### Is this your first time submitting a feature request?

- [X] I have read the [expectations for open source contributors](https://docs.getdbt.com/docs/contributing/oss-expectations)
- [X] I have searched the existing issues, and I could not find an existing issue for this feature
- [X] I am requesting a straightforward extension of existing dbt-bigquery functionality, rather than a Big Idea better suited to a discussion

### Describe the feature

We should support overriding the way `grant_access_to` works, in the same way that we can override `apply_grants` here: https://github.com/dbt-labs/dbt-core/issues/6164#issuecomment-1296458948

I am assuming there is some distinction in the way we're using `adapter` that makes this currently not possible to override; I have tried various combinations including `grant_access_to`, `default__grant_access_to`, and `bigquery__grant_access_to`, but none of them alter the behaviour except when I explicitly call it from another macro I create. Hence this feature would be to expose it in such a way that it can be overridden.

### Describe alternatives you've considered

As discussed in the linked post, there are alternatives that can achieve similar goals. However, I believe this should be implemented regardless for two reasons:

1. It ensures `grant_access_to` behaves similarly to `grant_access`
2. Overriding `apply_grants` is the recommended way to set a global conditional on the application of grants, but currently there is no way to do a similar thing for `grant_access_to`

### Who will this benefit?

Anyone who wants to alter the behaviour of grants in BigQuery, especially for conditional application of grants in non-prod environments. This has significant benefits for slim CI as well, as the current implementation can lead to failures when grants are attempted to be issued to datasets that don't exist because they weren't part of the modified models.

### Are you interested in contributing this feature?

Yes, but I don't think I have the necessary context to understand the required changes

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.