diff --git a/.changes/2.0.1.md b/.changes/2.0.1.md new file mode 100644 index 0000000..b5f7ef6 --- /dev/null +++ b/.changes/2.0.1.md @@ -0,0 +1,7 @@ +## dbt-snowflake-query-tags 2.0.1 - February 24, 2023 + +### Features + +- Add dbt tags to comment metadata ([#9](https://github.com/get-select/dbt-snowflake-query-tags/pull/9)) + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ed4a30..68cded0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## dbt-snowflake-query-tags 2.0.1 - February 24, 2023 + +### Features + +- Add dbt tags to comment metadata ([#9](https://github.com/get-select/dbt-snowflake-query-tags/pull/9)) + + + ## dbt-snowflake-query-tags 2.0.0 - February 24, 2023 ### Fixes diff --git a/README.md b/README.md index b197e21..9260600 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ An example query comment contains: ```json { - "dbt_snowflake_query_tags_version": "2.0.0", + "dbt_snowflake_query_tags_version": "2.0.1", "app": "dbt", "dbt_version": "1.4.0", "project_name": "my_project", @@ -26,6 +26,7 @@ An example query comment contains: "node_schema": "dev", "node_id": "model.my_project.model_a", "node_resource_type": "model", + "node_tags": ["tag_1", "tag_2"], "materialized": "incremental", -- dbt Cloud only @@ -41,7 +42,7 @@ Query tags are used solely for attaching the `is_incremental` flag, as this isn' ```json { - "dbt_snowflake_query_tags_version": "2.0.0", + "dbt_snowflake_query_tags_version": "2.0.1", "app": "dbt", "is_incremental": true } diff --git a/dbt_project.yml b/dbt_project.yml index f0d9318..f9fcfe3 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,3 +1,3 @@ name: 'dbt_snowflake_query_tags' -version: '2.0.0' +version: '2.0.1' config-version: 2 diff --git a/integration_test_project/models/materialized_incremental.sql b/integration_test_project/models/materialized_incremental.sql index 9dfee54..bd6e4fc 100644 --- a/integration_test_project/models/materialized_incremental.sql +++ b/integration_test_project/models/materialized_incremental.sql @@ -1,4 +1,4 @@ -{{ config(materialized='incremental') }} +{{ config(materialized='incremental', tags=['a', 'b', 'c']) }} select 1 as a diff --git a/integration_test_project/models/materialized_table.sql b/integration_test_project/models/materialized_table.sql index 7c4cc59..259941e 100644 --- a/integration_test_project/models/materialized_table.sql +++ b/integration_test_project/models/materialized_table.sql @@ -1,3 +1,3 @@ -{{ config(materialized='table') }} +{{ config(materialized='table', tags='a') }} select 1 as a diff --git a/macros/query_comment.sql b/macros/query_comment.sql index 73e3ee8..8ae118b 100644 --- a/macros/query_comment.sql +++ b/macros/query_comment.sql @@ -2,7 +2,7 @@ {%- set comment_dict = {} -%} {%- do comment_dict.update( app='dbt', - dbt_snowflake_query_tags_version='2.0.0', + dbt_snowflake_query_tags_version='2.0.1', dbt_version=dbt_version, project_name=project_name, target_name=target.name, @@ -21,6 +21,7 @@ node_schema=node.schema, node_id=node.unique_id, node_resource_type=node.resource_type, + node_tags=node.tags, ) -%} {%- if node.resource_type != ('seed') -%} {# Otherwise this throws an error saying 'Seeds cannot depend on other nodes.' #} diff --git a/macros/query_tags.sql b/macros/query_tags.sql index bd81a01..42e8a78 100644 --- a/macros/query_tags.sql +++ b/macros/query_tags.sql @@ -8,7 +8,7 @@ {%- do tag_dict.update( app='dbt', - dbt_snowflake_query_tags_version='2.0.0', + dbt_snowflake_query_tags_version='2.0.1', ) -%} {# We have to bring is_incremental through here because its not available in the comment context #}