Skip to content

Commit 41ac326

Browse files
authored
Merge pull request #4 from get-select/fix_refs
Fix refs
2 parents 0b4ba14 + f13b719 commit 41ac326

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

.changes/1.1.1.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## dbt-snowflake-query-tags 1.1.1 - February 12, 2023
2+
3+
### Fixes
4+
5+
- Fix refs list ([#4](https://github.com/get-select/dbt-snowflake-query-tags/pull/4))
6+
7+

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
66
and is generated by [Changie](https://github.com/miniscruff/changie).
77

8+
## dbt-snowflake-query-tags 1.1.1 - February 12, 2023
9+
10+
### Fixes
11+
12+
- Fix refs list ([#4](https://github.com/get-select/dbt-snowflake-query-tags/pull/4))
13+
14+
15+
816
## dbt-snowflake-query-tags 1.1.0 - February 11, 2023
917

1018
### Features

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ From the [SELECT](https://select.dev) team, a dbt package to automatically tag d
44

55
```json
66
{
7-
"dbt_snowflake_query_tags_version": "1.1.0",
7+
"dbt_snowflake_query_tags_version": "1.1.1",
88
"app": "dbt",
99
"dbt_version": "1.4.0",
1010
"project_name": "my_project",
@@ -23,12 +23,8 @@ From the [SELECT](https://select.dev) team, a dbt package to automatically tag d
2323
"materialized": "incremental",
2424
"is_incremental": true,
2525
"node_refs": [
26-
[
27-
"raw_orders"
28-
],
29-
[
30-
"product_mapping"
31-
]
26+
"raw_orders",
27+
"product_mapping"
3228
]
3329
}
3430
```
@@ -49,7 +45,7 @@ dbt_cloud_run_reason
4945
```yaml
5046
packages:
5147
- package: get-select/dbt_snowflake_query_tags
52-
version: 1.0.0
48+
version: 1.1.1
5349
```
5450
5551
2. If it doesn't already exist, create a folder named `macros` in your dbt project's top level directory. Inside, make a new file called `query_tags.sql` with the following content:

dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
name: 'dbt_snowflake_query_tags'
2-
version: '1.0.0'
2+
version: '1.1.1'
33
config-version: 2

integration_test_project/models/materialized_incremental.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
select 1 as a
44

55
-- {{ ref('materialized_table') }}
6+
-- {{ ref('materialized_view') }}

macros/query_tags.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{# Regardless of resource type, we can always access the config via the 'model' variable #}
66
{%- do tag_dict.update(
7-
dbt_snowflake_query_tags_version='1.0.0',
7+
dbt_snowflake_query_tags_version='1.1.1',
88
app='dbt',
99
dbt_version=dbt_version,
1010
project_name=project_name,
@@ -26,8 +26,11 @@
2626

2727
{%- if model.refs is defined -%}
2828
{%- do tag_dict.update(
29-
node_refs=model.refs
29+
node_refs=[]
3030
) -%}
31+
{% for ref in model.refs %}
32+
{%- do tag_dict.node_refs.append(ref[0]) -%}
33+
{% endfor %}
3134
{%- endif -%}
3235

3336
{# dbt Cloud stuff #}

0 commit comments

Comments
 (0)