diff --git a/.changes/unreleased/Fixes-20240930-213044.yaml b/.changes/unreleased/Fixes-20240930-213044.yaml new file mode 100644 index 0000000..7361c44 --- /dev/null +++ b/.changes/unreleased/Fixes-20240930-213044.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: rename macro to workaround a <1.6 bug +time: 2024-09-30T21:30:44.308764+02:00 +custom: + Author: Kayrnt + Issue: "26" diff --git a/macros/materialization_view_if_explicit_projects.sql b/macros/materialization_view_if_explicit_projects.sql index 784a11b..43e7223 100644 --- a/macros/materialization_view_if_explicit_projects.sql +++ b/macros/materialization_view_if_explicit_projects.sql @@ -4,7 +4,7 @@ unless the entity is created in the same project that is issuing the query, but these references are not project-qualified: "region-XXX.INFORMATION_SCHEMA.XXX" -#} -{% macro materialization_view_if_explicit_projects() -%} +{% macro materialized_as_view_if_explicit_projects() -%} {% if var('input_gcp_projects', []) | length == 0 %} {{ return('ephemeral') }} {% else %} diff --git a/models/base/jobs_by_project_with_cost.sql b/models/base/jobs_by_project_with_cost.sql index d2916ec..1d56c0e 100644 --- a/models/base/jobs_by_project_with_cost.sql +++ b/models/base/jobs_by_project_with_cost.sql @@ -1,6 +1,6 @@ {{ config( - materialized=materialization_view_if_explicit_projects() + materialized=materialized_as_view_if_explicit_projects() ) }} {{ jobs_with_cost_base("information_schema_jobs_by_project", contains_query = True) }} diff --git a/models/base/jobs_with_cost.sql b/models/base/jobs_with_cost.sql index 0104963..9c9e1dc 100644 --- a/models/base/jobs_with_cost.sql +++ b/models/base/jobs_with_cost.sql @@ -1,6 +1,6 @@ {{ config( - materialized=materialization_view_if_explicit_projects() + materialized=materialized_as_view_if_explicit_projects() ) }} {{ jobs_with_cost_base("information_schema_jobs", contains_query = False) }} diff --git a/models/base/storage_with_cost.sql b/models/base/storage_with_cost.sql index e6981aa..2db07a4 100644 --- a/models/base/storage_with_cost.sql +++ b/models/base/storage_with_cost.sql @@ -1,6 +1,6 @@ {{ config( - materialized=materialization_view_if_explicit_projects() + materialized=materialized_as_view_if_explicit_projects() ) }} {# More details about base table in https://cloud.google.com/bigquery/docs/information-schema-tables -#} diff --git a/models/base/table_and_storage_with_cost.sql b/models/base/table_and_storage_with_cost.sql index aadfcb5..bf2867f 100644 --- a/models/base/table_and_storage_with_cost.sql +++ b/models/base/table_and_storage_with_cost.sql @@ -1,6 +1,6 @@ {{ config( - materialized=materialization_view_if_explicit_projects() + materialized=materialized_as_view_if_explicit_projects() ) }} WITH base AS (