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.
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
Add Grant SQL Macros #5369
Add Grant SQL Macros #5369
Changes from 33 commits
6e88fe7
6d4b938
ea35fd1
7e2b707
898aa8f
76050da
7a3e7c6
5fb07c1
4cf705f
2fff84b
6fccef6
528dff6
95f7ae4
9079c4a
6bdb4b5
597ab05
138f443
fc7e24b
6f53b3d
b3e37cb
99b1445
7946a3b
0597398
1d263b7
c2e9aeb
0843f66
077e4ff
ab6be85
da557d9
f2c957f
eb935d5
cefcd4f
bdc0c71
67f5beb
72bdae9
794f4d1
068c59b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have we tested the performance on this when the grants dict config is huge (and very different from current grants)? might not suck once, but might if they have this same complicated diff on hundreds of models?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code can + should absolutely be refactored for more Pythonic comprehension + better performance / lower memory footprint. I'm not the right person to do that :)
FWIW this code will be executed in parallel
--threads
, assuming the user is making use of themThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not something needed to do before merging, but we added the same change pretty much for all materialization methods. Should we consider refactoring the code so we can only do it in one place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a TODO, just an open question: Should we / do we need to limit ourselves to just the grants provided by the
current_role
?To copy-paste what I just said in
dbt-snowflake
:By removing this logic, we'd be making a strong claim, that ALL the grants applied on this object, MUST be applied by dbt, in the
grants
config. I think that might be a strong opinion we want to hold!No action needed right now. Just wanted to leave the comment for future reference.