Skip to content

Commit

Permalink
Merge pull request #4 from get-select/fix_refs
Browse files Browse the repository at this point in the history
Fix refs
  • Loading branch information
NiallRees authored Feb 12, 2023
2 parents 0b4ba14 + f13b719 commit 41ac326
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 11 deletions.
7 changes: 7 additions & 0 deletions .changes/1.1.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## dbt-snowflake-query-tags 1.1.1 - February 12, 2023

### Fixes

- Fix refs list ([#4](https://github.com/get-select/dbt-snowflake-query-tags/pull/4))


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 1.1.1 - February 12, 2023

### Fixes

- Fix refs list ([#4](https://github.com/get-select/dbt-snowflake-query-tags/pull/4))



## dbt-snowflake-query-tags 1.1.0 - February 11, 2023

### Features
Expand Down
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ From the [SELECT](https://select.dev) team, a dbt package to automatically tag d

```json
{
"dbt_snowflake_query_tags_version": "1.1.0",
"dbt_snowflake_query_tags_version": "1.1.1",
"app": "dbt",
"dbt_version": "1.4.0",
"project_name": "my_project",
Expand All @@ -23,12 +23,8 @@ From the [SELECT](https://select.dev) team, a dbt package to automatically tag d
"materialized": "incremental",
"is_incremental": true,
"node_refs": [
[
"raw_orders"
],
[
"product_mapping"
]
"raw_orders",
"product_mapping"
]
}
```
Expand All @@ -49,7 +45,7 @@ dbt_cloud_run_reason
```yaml
packages:
- package: get-select/dbt_snowflake_query_tags
version: 1.0.0
version: 1.1.1
```
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:
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: '1.0.0'
version: '1.1.1'
config-version: 2
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
select 1 as a

-- {{ ref('materialized_table') }}
-- {{ ref('materialized_view') }}
7 changes: 5 additions & 2 deletions macros/query_tags.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

{%- if model.refs is defined -%}
{%- do tag_dict.update(
node_refs=model.refs
node_refs=[]
) -%}
{% for ref in model.refs %}
{%- do tag_dict.node_refs.append(ref[0]) -%}
{% endfor %}
{%- endif -%}

{# dbt Cloud stuff #}
Expand Down

0 comments on commit 41ac326

Please sign in to comment.