Skip to content

Commit

Permalink
Merge pull request #9 from get-select/add_node_tags
Browse files Browse the repository at this point in the history
Add node tags
  • Loading branch information
NiallRees authored Feb 24, 2023
2 parents b5b6d1b + 691658c commit 591ea48
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .changes/2.0.1.md
Original file line number Diff line number Diff line change
@@ -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))


8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: 'dbt_snowflake_query_tags'
version: '2.0.0'
version: '2.0.1'
config-version: 2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental', tags=['a', 'b', 'c']) }}

select 1 as a

Expand Down
2 changes: 1 addition & 1 deletion integration_test_project/models/materialized_table.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{ config(materialized='table') }}
{{ config(materialized='table', tags='a') }}

select 1 as a
3 changes: 2 additions & 1 deletion macros/query_comment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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.' #}
Expand Down
2 changes: 1 addition & 1 deletion macros/query_tags.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 #}
Expand Down

0 comments on commit 591ea48

Please sign in to comment.