This commit is contained in:
Austin 2023-09-07 10:22:06 -04:00 committed by GitHub
parent 63ca4e938a
commit 977553f703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 12 deletions

View File

@ -37,7 +37,18 @@ on-run-start:
- "{{ create_udfs() }}"
on-run-end:
- "{{ apply_meta_as_tags(results) }}"
- '{{ apply_meta_as_tags(results) }}'
dispatch:
- macro_namespace: dbt
search_order:
- ethereum-models
- dbt_snowflake_query_tags
- dbt
query-comment:
comment: '{{ dbt_snowflake_query_tags.get_query_comment(node) }}'
append: true # Snowflake removes prefixed comments.
# Configuring models
# Full documentation: https://docs.getdbt.com/docs/configuring-models

View File

@ -1,11 +0,0 @@
{% macro set_query_tag() -%}
{% set new_json = {"repo":project_name, "object":this.table, "profile":target.profile_name, "env":target.name, "existing_tag":get_current_query_tag() } %}
{% set new_query_tag = tojson(new_json) | as_text %}
{% if new_query_tag %}
{% set original_query_tag = get_current_query_tag() %}
{{ log("Setting query_tag to '" ~ new_query_tag ~ "'. Will reset to '" ~ original_query_tag ~ "' after materialization.") }}
{% do run_query("alter session set query_tag = '{}'".format(new_query_tag)) %}
{{ return(original_query_tag)}}
{% endif %}
{{ return(none)}}
{% endmacro %}

View File

@ -7,3 +7,5 @@ packages:
version: 1.0.0
- git: https://github.com/FlipsideCrypto/fsc-utils.git
revision: v1.4.1
- package: get-select/dbt_snowflake_query_tags
version: [">=2.0.0", "<3.0.0"]