feat: add grants for BigQuery#5444
Merged
newtonapple merged 4 commits intoddai/grantsfrom Sep 29, 2025
Merged
Conversation
a76f960 to
6d529ce
Compare
1ca93cd to
40f8011
Compare
6d529ce to
6f4412d
Compare
eakmanrq
approved these changes
Sep 26, 2025
836ebb7 to
18424e9
Compare
18424e9 to
62755b8
Compare
eakmanrq
reviewed
Sep 29, 2025
| self._connection_pool.set_attribute("session_id", value) | ||
|
|
||
| def _get_bq_dataset_location(self, project: str, dataset: str) -> str: | ||
| return self._db_call(self.client.get_dataset, dataset_ref=f"{project}.{dataset}").location |
Collaborator
There was a problem hiding this comment.
Do you know if dataset_ref needs to be properly quoted? Or are you assuming the strings passed in will have quotes if needed?
Contributor
Author
There was a problem hiding this comment.
Yeah, I checked their API. I don't think we need to quote it.
eakmanrq
reviewed
Sep 29, 2025
| def _get_bq_dataset_location(self, project: str, dataset: str) -> str: | ||
| return self._db_call(self.client.get_dataset, dataset_ref=f"{project}.{dataset}").location | ||
|
|
||
| def _get_current_grants_config(self, table: exp.Table) -> GrantsConfig: |
Collaborator
There was a problem hiding this comment.
Can you override _get_grant_expression instead?
62755b8 to
a9efb1c
Compare
a9efb1c to
2030b6b
Compare
newtonapple
added a commit
that referenced
this pull request
Sep 29, 2025
Co-authored-by: eakmanrq <6326532+eakmanrq@users.noreply.github.com>
newtonapple
added a commit
that referenced
this pull request
Sep 30, 2025
Co-authored-by: eakmanrq <6326532+eakmanrq@users.noreply.github.com>
newtonapple
added a commit
that referenced
this pull request
Oct 2, 2025
Co-authored-by: eakmanrq <6326532+eakmanrq@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note:
BigQuery's INFORMATION_SCHEMA only has OBJECT_PRIVILEGES. And it must be queried with project, region location and
object_namein the WHERE clause.Additionally, we are enforcing labels on a grantees:
user:,domain:,group:,specialGroup:and will always lower-case grantee identity as they get lower-cased by BigQuery.specialGroupcontainsallUsers&allAuthenticatedUsers. These are case-sensitive and will always returned with the labelsepcialGroupwhen queryingOBJECT_PRIVILEGES.For more info on BigQuery DCL: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-control-language