Add grant execution to pit and bridge materialization #242
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.
Related_issue
Describe the bug
When using the materializations
pit_incremental
orbridge_incremental
, Grant statements defined in the dbt_project or in models directly are not being executed at all, not even for models with other materializations like the official materializations provided by dbt.We are aware that the PIT and BRDIGE macros have been deprecated in the latest version of AutomateDV, however, it would be great if this can still be fixed to ensure users can still make use of those macros until alternatives are provided.
Environment
dbt version: 1.7.13
automate_dv version: 0.11.0
Database/Platform: Snowflake
To Reproduce
Steps to reproduce the behavior:
[Option 1] Test in production
pit_incremental
orbridge_incremental
show grants on table <database_name>.<schema_name>.<table_name>;
[Option 2] Test locally
pit_incremental
orbridge_incremental
dbt_run
for the respective modelExpected behavior
[Option 1]
The database role that has been assigned in dbt should be granted to the respective table(s)
[Option 2]
The dbt run should fail and a SQL compilation error should be thrown stating that "Role '<role_name>' does not exist or not authorized", given that the role name does actually not exist.
Screenshots
dbt_project config for Business Vault
Additional context
In version 1.2 dbt has added the execution of Grant configs to their materialization macros (Commit). However, it seems like this hasn´t been added to the AutomateDV materialization macros for PIT and BRIDGE tables.