dbt-snowflake icon indicating copy to clipboard operation
dbt-snowflake copied to clipboard

[Feature] copy_grants option for seeds (for use in Snowflake Data Share)

Open sarah-tuva opened this issue 9 months ago • 4 comments

Is this a new bug in dbt-snowflake?

  • [X] I believe this is a new bug in dbt-snowflake
  • [X] I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

We added the copy_grants: true config to our dbt_project.yml. We are setting this option for the base project and a package. We also have a data share set up in Snowflake to share the tables created by the dbt project with another Snowflake account.

models:
  +copy_grants: true
  the_tuva_project:
    +copy_grants: true

seeds:
  +copy_grants: true
  the_tuva_project:
    terminology:
      +copy_grants: true
    value_sets:
      +copy_grants: true

(note: we also tried just setting the copy_grants variable at the highest levels of the models and seeds.)

When we run dbt build --full-refresh, the model tables are still shared, but the seed tables become unshared (i.e. the seed tables become unchecked in the Snowflake data share settings and we have to reshare them). When we run dbt build, we do not see this problem.

Expected Behavior

Both the model and seed tables should be fully refreshed and stay shared in the Snowflake data share. We should not have to re-share them each time we run dbt build --full-refresh.

Steps To Reproduce

  1. Add the copy_grants config to the dbt_project.yml
  2. Run dbt build
  3. Create a data share in Snowflake and share the tables created by models and seeds
  4. Run dbt build --full-refresh
  5. The seed tables become unchecked and are no longer shared, the model tables are still shared

Relevant log output

No response

Environment

- OS: macOS-14.4.1-arm64-arm-64bit
- Python: 3.9.6
- dbt-core: 1.7.4
- dbt-snowflake: 1.7.1

Additional Context

No response

sarah-tuva avatar May 09 '24 15:05 sarah-tuva