Skip to content

Commit

Permalink
Merge pull request #26 from bmoore813/bm/dbt-precompiled-model-hash
Browse files Browse the repository at this point in the history
bm/dbt-precompiled-model-hash
  • Loading branch information
NiallRees authored May 14, 2024
2 parents 4b30044 + a3137b7 commit 8d30ce0
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions macros/query_comment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -53,36 +53,42 @@
materialized=node.config.materialized,
) -%}
{%- endif -%}

{%- if node.raw_code is not none -%}
{%- do comment_dict.update({
"raw_code_hash": local_md5(node.raw_code)
}) -%}
{%- endif -%}
{%- endif -%}

{%- if env_var('DBT_CLOUD_PROJECT_ID', False) -%}
{%- do comment_dict.update(
dbt_cloud_project_id=env_var('DBT_CLOUD_PROJECT_ID')
) -%}
{%- do comment_dict.update(
dbt_cloud_project_id=env_var('DBT_CLOUD_PROJECT_ID')
) -%}
{%- endif -%}

{%- if env_var('DBT_CLOUD_JOB_ID', False) -%}
{%- do comment_dict.update(
dbt_cloud_job_id=env_var('DBT_CLOUD_JOB_ID')
) -%}
{%- do comment_dict.update(
dbt_cloud_job_id=env_var('DBT_CLOUD_JOB_ID')
) -%}
{%- endif -%}

{%- if env_var('DBT_CLOUD_RUN_ID', False) -%}
{%- do comment_dict.update(
dbt_cloud_run_id=env_var('DBT_CLOUD_RUN_ID')
) -%}
{%- do comment_dict.update(
dbt_cloud_run_id=env_var('DBT_CLOUD_RUN_ID')
) -%}
{%- endif -%}

{%- if env_var('DBT_CLOUD_RUN_REASON_CATEGORY', False) -%}
{%- do comment_dict.update(
dbt_cloud_run_reason_category=env_var('DBT_CLOUD_RUN_REASON_CATEGORY')
) -%}
{%- do comment_dict.update(
dbt_cloud_run_reason_category=env_var('DBT_CLOUD_RUN_REASON_CATEGORY')
) -%}
{%- endif -%}

{%- if env_var('DBT_CLOUD_RUN_REASON', False) -%}
{%- do comment_dict.update(
dbt_cloud_run_reason=env_var('DBT_CLOUD_RUN_REASON')
) -%}
{%- do comment_dict.update(
dbt_cloud_run_reason=env_var('DBT_CLOUD_RUN_REASON')
) -%}
{%- endif -%}

{{ return(tojson(comment_dict)) }}
Expand Down

0 comments on commit 8d30ce0

Please sign in to comment.