feat(snowflake) Add COPY TAGS support mirroring COPY GRANTS behavior - #1858
Merged
colin-k-rogers merged 4 commits intoMay 8, 2026
Merged
Conversation
Snowflake's new COPY TAGS parameter (GA as of Apr 2, 2026) retains tags from a replaced table and its columns during CREATE OR REPLACE TABLE. This adds identical support to COPY GRANTS across all applicable macros.
colin-k-rogers
had a problem deploying
to
dbt-snowflake
May 7, 2026 23:01 — with
GitHub Actions
Error
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Snowflake adapter support for Snowflake’s COPY TAGS clause, modeled after existing copy_grants behavior, and verifies behavior via unit + functional tests.
Changes:
- Introduces
copy_tagsas an adapter config field (SnowflakeConfig) and wires it into DDL generation. - Emits
copy tagsinCREATE OR REPLACE TABLE(regular + built-in Iceberg) andCREATE OR REPLACE … CLONEwhen enabled. - Adds unit/functional tests plus an unreleased changelog entry for the feature.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dbt-snowflake/src/dbt/adapters/snowflake/impl.py | Adds copy_tags to SnowflakeConfig so the config is recognized/typed by the adapter. |
| dbt-snowflake/src/dbt/include/snowflake/macros/relations/table/create.sql | Adds conditional copy tags emission for regular and built-in Iceberg create/replace table SQL. |
| dbt-snowflake/src/dbt/include/snowflake/macros/materializations/clone.sql | Adds conditional copy tags emission for clone DDL. |
| dbt-snowflake/tests/unit/test_copy_tags.py | Unit tests around SnowflakeConfig.copy_tags defaults and independence from copy_grants. |
| dbt-snowflake/tests/functional/adapter/test_copy_tags.py | Functional tests asserting compiled SQL includes/excludes copy tags appropriately. |
| dbt-snowflake/.changes/unreleased/Features-20260413-120000.yaml | Unreleased changelog entry describing the new capability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Small copilot comments Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
colin-k-rogers
temporarily deployed
to
dbt-snowflake
May 7, 2026 23:29 — with
GitHub Actions
Inactive
colin-k-rogers
approved these changes
May 7, 2026
|
@sfc-gh-yostrinsky Is there a reason this doesn't work for views? |
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.
Summary
copy_tagsconfig option (boolean, defaultfalse) mirroringcopy_grantsCREATE OR REPLACE TABLECREATE OR REPLACEsupport)Resolves #1857
Changes
impl.py—copy_tags: Optional[bool] = NoneinSnowflakeConfigtable/create.sql—COPY TAGSclause insnowflake__create_table_info_schema_sqlandsnowflake__create_table_built_in_sqlclone.sql—COPY TAGSclause insnowflake__create_or_replace_clonetests/unit/test_copy_tags.py— Unit tests for config field validationtests/functional/adapter/test_copy_tags.py— Functional tests verifying DDL outputTest plan
pytest tests/unit/test_copy_tags.pypytest tests/functional/adapter/test_copy_tags.py.test_extra_configtests still pass (no regressions)copy_tagsappears in compiled SQL when enabledcopy_tagsdoes NOT appear when disabled (default)