From 4d794b17d3f1e39682513261db621a3447e0dddb Mon Sep 17 00:00:00 2001 From: NiallRees Date: Fri, 24 Feb 2023 12:58:19 +0000 Subject: [PATCH 1/2] Add node tags --- README.md | 1 + integration_test_project/models/materialized_incremental.sql | 2 +- integration_test_project/models/materialized_table.sql | 2 +- macros/query_comment.sql | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b197e21..089a5a8 100644 --- a/README.md +++ b/README.md @@ -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 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..e25d295 100644 --- a/macros/query_comment.sql +++ b/macros/query_comment.sql @@ -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.' #} From 691658cc8503fb848ac07adcbe4c0fa56866c212 Mon Sep 17 00:00:00 2001 From: NiallRees Date: Fri, 24 Feb 2023 13:01:01 +0000 Subject: [PATCH 2/2] Release 2.0.1 --- .changes/2.0.1.md | 7 +++++++ CHANGELOG.md | 8 ++++++++ README.md | 4 ++-- dbt_project.yml | 2 +- macros/query_comment.sql | 2 +- macros/query_tags.sql | 2 +- 6 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .changes/2.0.1.md 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 089a5a8..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", @@ -42,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/macros/query_comment.sql b/macros/query_comment.sql index e25d295..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, 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 #}